From 25e6dc4adb332cd65ea42bb3cea2160a9b8c393e 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(-) (limited to 'indra/newview/llimprocessing.cpp') 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 9887af162b1a5c4507d89d3f0d1392da7ee52b50 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(-) (limited to 'indra/newview/llimprocessing.cpp') 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 5f9a18c88f36897df025242921b319a2b84404c4 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(+) (limited to 'indra/newview/llimprocessing.cpp') 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 8bf2078e90a6301d58581135a5d26362186ec0e8 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(-) (limited to 'indra/newview/llimprocessing.cpp') 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 52f888b8d34483f8c9158d2ce7aaec33731ee1f5 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(-) (limited to 'indra/newview/llimprocessing.cpp') 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 From 3379259ffbc5bac0bf19097f1e83c137095be9ba Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 1 Jul 2020 16:52:44 -0700 Subject: SL-13533: Use the old name for from_agent_name SL-13540: Do not fail if binary bucket is too large, attempt to extract the asset type from the old style bucket. Notification still not shown. --- indra/newview/llimprocessing.cpp | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'indra/newview/llimprocessing.cpp') diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index fc209c2eae..301b4c9214 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -857,13 +857,28 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, } else // IM_TASK_INVENTORY_OFFERED { - if (sizeof(S8) != binary_bucket_size) + 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]; + } + else + { + /*RIDER*/ // The previous version of the protocol returned the wrong binary bucket... we + // still might be able to figure out the type... even though the offer is not retrievable. + std::string str_bucket(reinterpret_cast(binary_bucket)); + std::string str_type(str_bucket.substr(0, str_bucket.find('|'))); + + std::stringstream type_convert(str_type); + + S32 type; + type_convert >> type; + + // We could try AT_UNKNOWN which would be more accurate, but that causes an auto decline + info->mType = static_cast(type); + // Don't break in the case of a bad binary bucket. Go ahead and show the + // accept/decline popup even though it will not do anything. + LL_WARNS("Messaging") << "Malformed inventory offer from object, type might be " << info->mType << LL_ENDL; } - info->mType = (LLAssetType::EType) binary_bucket[0]; info->mObjectID = LLUUID::null; info->mFromObject = TRUE; } @@ -1601,8 +1616,8 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) 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(), + message_data["from_agent_name"].asString(), + message_data["message"].asString(), static_cast((message_data.has("parent_estate_id")) ? message_data["parent_estate_id"].asInteger() : 1), // 1 - IMMainland message_data["region_id"].asUUID(), position, -- cgit v1.2.3 From 7c122757f9ed2bd3b7ba033905db1dcb143eec6d Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 2 Jul 2020 13:03:57 +0300 Subject: SL-13540 Offline scripted inventory offers not shown on non drtsim-451 --- indra/newview/llimprocessing.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'indra/newview/llimprocessing.cpp') diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 301b4c9214..5c9d53e0b9 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -865,6 +865,8 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, { /*RIDER*/ // The previous version of the protocol returned the wrong binary bucket... we // still might be able to figure out the type... even though the offer is not retrievable. + + // Should be safe to remove once DRTSIM-451 fully deploys std::string str_bucket(reinterpret_cast(binary_bucket)); std::string str_type(str_bucket.substr(0, str_bucket.find('|'))); @@ -1575,8 +1577,6 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) LL_INFOS("Messaging") << "Processing offline messages." << LL_ENDL; -// std::vector data; -// S32 binary_bucket_size = 0; LLHost sender = gAgent.getRegionHost(); LLSD::array_iterator i = messages.beginArray(); @@ -1608,11 +1608,22 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) bin_bucket.push_back(0); } + // Todo: once drtsim-451 releases, remove the string option + BOOL from_group; + if (message_data["from_group"].isInteger()) + { + from_group = message_data["from_group"].asInteger(); + } + else + { + from_group = message_data["from_group"].asString() == "Y"; + } + LLIMProcessing::processNewMessage( message_data["from_agent_id"].asUUID(), - message_data["from_group"].asBoolean(), + from_group, message_data["to_agent_id"].asUUID(), - static_cast(message_data["offline"].asInteger()), + message_data.has("offline") ? static_cast(message_data["offline"].asInteger()) : IM_OFFLINE, static_cast(message_data["dialog"].asInteger()), message_data["transaction-id"].asUUID(), static_cast(message_data["timestamp"].asInteger()), -- cgit v1.2.3 From fa1ae9fa1adfdaaa79c3093cf628eb08a99575bb Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 3 Jul 2020 20:40:41 +0300 Subject: SL-13540 Fix line endings --- indra/newview/llimprocessing.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'indra/newview/llimprocessing.cpp') diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 5c9d53e0b9..79cf49ddb1 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -1608,15 +1608,15 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) bin_bucket.push_back(0); } - // Todo: once drtsim-451 releases, remove the string option - BOOL from_group; - if (message_data["from_group"].isInteger()) - { - from_group = message_data["from_group"].asInteger(); - } - else - { - from_group = message_data["from_group"].asString() == "Y"; + // Todo: once drtsim-451 releases, remove the string option + BOOL from_group; + if (message_data["from_group"].isInteger()) + { + from_group = message_data["from_group"].asInteger(); + } + else + { + from_group = message_data["from_group"].asString() == "Y"; } LLIMProcessing::processNewMessage( -- cgit v1.2.3