summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2020-07-02 13:24:29 -0400
committerNat Goodspeed <nat@lindenlab.com>2020-07-02 13:24:29 -0400
commit5ab0ff486b98fb44c7472f84c35f353d1762b3d1 (patch)
treec1ce8da84a7a693ce426461d756f8a7ac4fef99b /indra
parent01128f9f945f20bc3c472ed953cb0c0fae6ce407 (diff)
parentbf5585c0ec9d6c2159a203ebdbd1b639689a5c50 (diff)
DRTVWR-476, SL-11430: Merge branch 'SL-9756' into d476
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llimprocessing.cpp48
1 files changed, 37 insertions, 11 deletions
diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp
index 3d22410208..7b87b43243 100644
--- a/indra/newview/llimprocessing.cpp
+++ b/indra/newview/llimprocessing.cpp
@@ -857,13 +857,30 @@ 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.
+
+ // Should be safe to remove once DRTSIM-451 fully deploys
+ std::string str_bucket(reinterpret_cast<char *>(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<LLAssetType::EType>(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;
}
@@ -1558,8 +1575,6 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url)
LL_INFOS("Messaging") << "Processing offline messages." << LL_ENDL;
-// std::vector<U8> data;
-// S32 binary_bucket_size = 0;
LLHost sender = gAgent.getRegionHost();
LLSD::array_iterator i = messages.beginArray();
@@ -1591,16 +1606,27 @@ 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<U8>(message_data["offline"].asInteger()),
+ message_data.has("offline") ? static_cast<U8>(message_data["offline"].asInteger()) : IM_OFFLINE,
static_cast<EInstantMessage>(message_data["dialog"].asInteger()),
message_data["transaction-id"].asUUID(),
static_cast<U32>(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<U32>((message_data.has("parent_estate_id")) ? message_data["parent_estate_id"].asInteger() : 1), // 1 - IMMainland
message_data["region_id"].asUUID(),
position,