From e2dd15397c709a3a37e70942d40373f5476a434b Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 20 May 2020 15:37:21 -0700 Subject: SL-9756: Take the "session_id" from the offline message that was passed. --- indra/newview/llimprocessing.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 6da7bbe263..b534fc0b4a 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -1608,7 +1608,7 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) message_data["to_agent_id"].asUUID(), IM_OFFLINE, (EInstantMessage)message_data["dialog"].asInteger(), - LLUUID::null, // session id, since there is none we can only use frienship/group invite caps + message_data["session_id"].asUUID(), message_data["timestamp"].asInteger(), message_data["from_agent_name"].asString(), message_data["message"].asString(), -- cgit v1.2.3 From c8b7466c1999cc834b90c9aed76d8548b66032c6 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 8 Jun 2020 11:28:05 -0700 Subject: SL-11430, SL-9756: Take transaction-id from offline messages. Correct LLSD names. Use offline flag rather than implicit tests of session_id and aux_id. --- indra/newview/llimprocessing.cpp | 61 +++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index b534fc0b4a..60f1de4e8c 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -857,7 +857,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, } else // IM_TASK_INVENTORY_OFFERED { - if (offline == IM_OFFLINE && session_id.isNull() && aux_id.notNull() && binary_bucket_size > sizeof(S8)* 5) + if (offline) { // cap received offline message std::string str_bucket = ll_safe_string((char*)binary_bucket, binary_bucket_size); @@ -889,9 +889,10 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, info->mIM = dialog; info->mFromID = from_id; info->mFromGroup = from_group; - info->mTransactionID = session_id; info->mFolderID = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(info->mType)); + info->mTransactionID = session_id.notNull() ? session_id : aux_id; + info->mFromName = name; info->mDesc = message; info->mHost = sender; @@ -1569,7 +1570,7 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) return; } - if (gAgent.getRegion() == NULL) + if (!gAgent.getRegion()) { LL_WARNS("Messaging") << "Region null while attempting to load messages." << LL_ENDL; return; @@ -1577,8 +1578,8 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) LL_INFOS("Messaging") << "Processing offline messages." << LL_ENDL; - std::vector data; - S32 binary_bucket_size = 0; +// std::vector data; +// S32 binary_bucket_size = 0; LLHost sender = gAgent.getRegionHost(); LLSD::array_iterator i = messages.beginArray(); @@ -1587,38 +1588,46 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) { const LLSD &message_data(*i); - LLVector3 position(message_data["local_x"].asReal(), message_data["local_y"].asReal(), message_data["local_z"].asReal()); - data = message_data["binary_bucket"].asBinary(); - binary_bucket_size = data.size(); // message_data["count"] always 0 - U32 parent_estate_id = message_data.has("parent_estate_id") ? message_data["parent_estate_id"].asInteger() : 1; // 1 - IMMainland + /* RIDER: Many fields in this message are using a '_' rather than the standard '-'. This + * should be changed but would require tight coordination with the simulator. + */ + LLVector3 position; + if (message_data.has("position")) + { + position.setValue(message_data["position"]); + } + else + { + position.set(message_data["local_x"].asReal(), message_data["local_y"].asReal(), message_data["local_z"].asReal()); + } - // Todo: once dirtsim-369 releases, remove one of the int/str options - BOOL from_group; - if (message_data["from_group"].isInteger()) + std::vector bin_bucket; + if (message_data.has("binary_bucket")) { - from_group = message_data["from_group"].asInteger(); + bin_bucket = message_data["binary_bucket"].asBinary(); } else { - from_group = message_data["from_group"].asString() == "Y"; + bin_bucket.push_back(0); } - LLIMProcessing::processNewMessage(message_data["from_agent_id"].asUUID(), - from_group, + LLIMProcessing::processNewMessage( + message_data["from_id"].asUUID(), + message_data["from_group"].asBoolean(), message_data["to_agent_id"].asUUID(), - IM_OFFLINE, - (EInstantMessage)message_data["dialog"].asInteger(), - message_data["session_id"].asUUID(), - message_data["timestamp"].asInteger(), - message_data["from_agent_name"].asString(), - message_data["message"].asString(), - parent_estate_id, + static_cast(message_data["offline"].asInteger()), + static_cast(message_data["dialog"].asInteger()), + message_data["transaction-id"].asUUID(), + static_cast(message_data["timestamp"].asInteger()), + message_data["from_name"].asString(), + (message_data.has("message")) ? message_data["message"].asString() : std::string(), + static_cast((message_data.has("parent_estate_id")) ? message_data["parent_estate_id"].asInteger() : 1), // 1 - IMMainland message_data["region_id"].asUUID(), position, - &data[0], - binary_bucket_size, + bin_bucket.data(), + bin_bucket.size(), sender, - message_data["asset_id"].asUUID()); // not necessarily an asset + message_data["asset_id"].asUUID()); } } -- cgit v1.2.3 From f8e53adce7c089abe9a50c353d14f7a548ce3f95 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 18 Jun 2020 12:56:00 -0700 Subject: SL-9756: Get session_id/transaction id from aux if session is missing. --- indra/newview/llimprocessing.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 60f1de4e8c..c274267b21 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -1628,6 +1628,7 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) bin_bucket.size(), sender, message_data["asset_id"].asUUID()); + } } -- cgit v1.2.3 From f72759c16d74d6a996b4b63f610b50c80c3db825 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 22 Jun 2020 10:55:05 -0700 Subject: SL-9756: IM_TASK_INVENTORY_OFFERED bucket offline format conforms to the online format. --- indra/newview/llimprocessing.cpp | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index c274267b21..a2900c553c 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -857,33 +857,15 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, } else // IM_TASK_INVENTORY_OFFERED { - if (offline) + if (sizeof(S8) != binary_bucket_size) { - // cap received offline message - std::string str_bucket = ll_safe_string((char*)binary_bucket, binary_bucket_size); - typedef boost::tokenizer > tokenizer; - boost::char_separator sep("|", "", boost::keep_empty_tokens); - tokenizer tokens(str_bucket, sep); - tokenizer::iterator iter = tokens.begin(); - - info->mType = (LLAssetType::EType)(atoi((*(iter++)).c_str())); - // Note There is more elements in 'tokens' ... - - info->mObjectID = LLUUID::null; - info->mFromObject = TRUE; - } - else - { - if (sizeof(S8) != binary_bucket_size) - { - LL_WARNS("Messaging") << "Malformed inventory offer from object" << LL_ENDL; - delete info; - break; - } - info->mType = (LLAssetType::EType) binary_bucket[0]; - info->mObjectID = LLUUID::null; - info->mFromObject = TRUE; + LL_WARNS("Messaging") << "Malformed inventory offer from object" << LL_ENDL; + delete info; + break; } + info->mType = (LLAssetType::EType) binary_bucket[0]; + info->mObjectID = LLUUID::null; + info->mFromObject = TRUE; } info->mIM = dialog; -- cgit v1.2.3 From 01f2308c85dd02d199072006e6b9ff42c90a1986 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 22 Jun 2020 16:08:11 -0700 Subject: SL-9756: Get the LLSD names right. --- indra/newview/llimprocessing.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index a2900c553c..fc209c2eae 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -1594,7 +1594,7 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) } LLIMProcessing::processNewMessage( - message_data["from_id"].asUUID(), + message_data["from_agent_id"].asUUID(), message_data["from_group"].asBoolean(), message_data["to_agent_id"].asUUID(), static_cast(message_data["offline"].asInteger()), -- cgit v1.2.3