Merge in offline item deliveries fix from upstream. This also reverts commit 24f54572.
This commit is contained in:
@@ -3,17 +3,6 @@
|
|||||||
<map>
|
<map>
|
||||||
<!-- Ascent-Specific Settings -->
|
<!-- Ascent-Specific Settings -->
|
||||||
|
|
||||||
<key>RGUseLegacyOfflines</key>
|
|
||||||
<map>
|
|
||||||
<key>Comment</key>
|
|
||||||
<string>Use legacy UDP offline messages retrieval, to avoid missing attachments server bug. Will be removed when LL fixes the cap.</string>
|
|
||||||
<key>Persist</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>Type</key>
|
|
||||||
<string>Boolean</string>
|
|
||||||
<key>Value</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
</map>
|
|
||||||
<key>SingularityBoldGroupModerator</key>
|
<key>SingularityBoldGroupModerator</key>
|
||||||
<map>
|
<map>
|
||||||
<key>Comment</key>
|
<key>Comment</key>
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
#include "llimprocessing.h"
|
#include "llimprocessing.h"
|
||||||
|
|
||||||
#include "hippofloaterxml.h"
|
#include "hippofloaterxml.h"
|
||||||
#include "hippogridmanager.h"
|
|
||||||
#include "llagent.h"
|
#include "llagent.h"
|
||||||
#include "llagentui.h"
|
#include "llagentui.h"
|
||||||
#include "llavataractions.h"
|
#include "llavataractions.h"
|
||||||
@@ -1197,41 +1196,41 @@ void LLIMProcessing::processNewMessage(const LLUUID& from_id,
|
|||||||
}
|
}
|
||||||
else // IM_TASK_INVENTORY_OFFERED
|
else // IM_TASK_INVENTORY_OFFERED
|
||||||
{
|
{
|
||||||
if (offline == IM_OFFLINE && session_id.isNull() && aux_id.notNull() && binary_bucket_size > sizeof(S8)* 5)
|
if (sizeof(S8) == binary_bucket_size)
|
||||||
{
|
{
|
||||||
// cap received offline message
|
info->mType = (LLAssetType::EType) binary_bucket[0];
|
||||||
std::string str_bucket = ll_safe_string((char*)binary_bucket, binary_bucket_size);
|
|
||||||
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
|
|
||||||
boost::char_separator<char> 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
|
else
|
||||||
{
|
{
|
||||||
if (sizeof(S8) != binary_bucket_size)
|
/*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.
|
||||||
LL_WARNS("Messaging") << "Malformed inventory offer from object" << LL_ENDL;
|
|
||||||
delete info;
|
// Should be safe to remove once DRTSIM-451 fully deploys
|
||||||
break;
|
std::string str_bucket(reinterpret_cast<char *>(binary_bucket));
|
||||||
}
|
std::string str_type(str_bucket.substr(0, str_bucket.find('|')));
|
||||||
info->mType = (LLAssetType::EType) binary_bucket[0];
|
|
||||||
info->mObjectID = LLUUID::null;
|
std::stringstream type_convert(str_type);
|
||||||
info->mFromObject = TRUE;
|
|
||||||
}
|
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->mObjectID = LLUUID::null;
|
||||||
|
info->mFromObject = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
info->mIM = dialog;
|
info->mIM = dialog;
|
||||||
info->mFromID = from_id;
|
info->mFromID = from_id;
|
||||||
info->mFromGroup = from_group;
|
info->mFromGroup = from_group;
|
||||||
info->mTransactionID = session_id;
|
|
||||||
info->mFolderID = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(info->mType));
|
info->mFolderID = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(info->mType));
|
||||||
|
|
||||||
|
info->mTransactionID = session_id.notNull() ? session_id : aux_id;
|
||||||
|
|
||||||
info->mFromName = name;
|
info->mFromName = name;
|
||||||
info->mDesc = message;
|
info->mDesc = message;
|
||||||
info->mHost = sender;
|
info->mHost = sender;
|
||||||
@@ -1878,7 +1877,6 @@ void LLIMProcessing::requestOfflineMessages()
|
|||||||
// to build a correct name. Likewise, inventory offers from
|
// to build a correct name. Likewise, inventory offers from
|
||||||
// muted avatars require the mute list to properly mute.
|
// muted avatars require the mute list to properly mute.
|
||||||
if (cap_url.empty()
|
if (cap_url.empty()
|
||||||
|| (gHippoGridManager->getConnectedGrid()->isSecondLife() && gSavedSettings.getBOOL("RGUseLegacyOfflines"))
|
|
||||||
|| gAgent.getRegionCapability("AcceptFriendship").empty()
|
|| gAgent.getRegionCapability("AcceptFriendship").empty()
|
||||||
|| gAgent.getRegionCapability("AcceptGroupInvite").empty())
|
|| gAgent.getRegionCapability("AcceptGroupInvite").empty())
|
||||||
{
|
{
|
||||||
@@ -1950,8 +1948,6 @@ void LLIMProcessing::requestOfflineMessagesCoro(const LLCoroResponder& responder
|
|||||||
|
|
||||||
LL_INFOS("Messaging") << "Processing offline messages." << LL_ENDL;
|
LL_INFOS("Messaging") << "Processing offline messages." << LL_ENDL;
|
||||||
|
|
||||||
std::vector<U8> data;
|
|
||||||
S32 binary_bucket_size = 0;
|
|
||||||
LLHost sender = gAgent.getRegion()->getHost();
|
LLHost sender = gAgent.getRegion()->getHost();
|
||||||
|
|
||||||
LLSD::array_iterator i = messages.beginArray();
|
LLSD::array_iterator i = messages.beginArray();
|
||||||
@@ -1960,12 +1956,31 @@ void LLIMProcessing::requestOfflineMessagesCoro(const LLCoroResponder& responder
|
|||||||
{
|
{
|
||||||
const LLSD &message_data(*i);
|
const LLSD &message_data(*i);
|
||||||
|
|
||||||
LLVector3 position(message_data["local_x"].asReal(), message_data["local_y"].asReal(), message_data["local_z"].asReal());
|
/* RIDER: Many fields in this message are using a '_' rather than the standard '-'. This
|
||||||
data = message_data["binary_bucket"].asBinary();
|
* should be changed but would require tight coordination with the simulator.
|
||||||
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
|
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
|
std::vector<U8> bin_bucket;
|
||||||
|
if (message_data.has("binary_bucket"))
|
||||||
|
{
|
||||||
|
bin_bucket = message_data["binary_bucket"].asBinary();
|
||||||
|
}
|
||||||
|
#if 0
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bin_bucket.push_back(0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
// Todo: once drtsim-451 releases, remove the string option
|
||||||
BOOL from_group;
|
BOOL from_group;
|
||||||
if (message_data["from_group"].isInteger())
|
if (message_data["from_group"].isInteger())
|
||||||
{
|
{
|
||||||
@@ -1978,20 +1993,21 @@ void LLIMProcessing::requestOfflineMessagesCoro(const LLCoroResponder& responder
|
|||||||
|
|
||||||
auto agentName = message_data["from_agent_name"].asString();
|
auto agentName = message_data["from_agent_name"].asString();
|
||||||
auto message = message_data["message"].asString();
|
auto message = message_data["message"].asString();
|
||||||
LLIMProcessing::processNewMessage(message_data["from_agent_id"].asUUID(),
|
LLIMProcessing::processNewMessage(
|
||||||
|
message_data["from_agent_id"].asUUID(),
|
||||||
from_group,
|
from_group,
|
||||||
message_data["to_agent_id"].asUUID(),
|
message_data["to_agent_id"].asUUID(),
|
||||||
IM_OFFLINE,
|
message_data.has("offline") ? static_cast<U8>(message_data["offline"].asInteger()) : IM_OFFLINE,
|
||||||
(EInstantMessage)message_data["dialog"].asInteger(),
|
static_cast<EInstantMessage>(message_data["dialog"].asInteger()),
|
||||||
LLUUID::null, // session id, since there is none we can only use frienship/group invite caps
|
message_data["transaction-id"].asUUID(),
|
||||||
message_data["timestamp"].asInteger(),
|
static_cast<U32>(message_data["timestamp"].asInteger()),
|
||||||
agentName,
|
agentName,
|
||||||
message,
|
message,
|
||||||
parent_estate_id,
|
message_data.has("parent_estate_id") ? static_cast<U32>(message_data["parent_estate_id"].asInteger()) : 1U, // 1 - IMMainland
|
||||||
message_data["region_id"].asUUID(),
|
message_data["region_id"].asUUID(),
|
||||||
position,
|
position,
|
||||||
&data[0],
|
bin_bucket.data(),
|
||||||
binary_bucket_size,
|
bin_bucket.size(),
|
||||||
sender,
|
sender,
|
||||||
message_data["asset_id"].asUUID()); // not necessarily an asset
|
message_data["asset_id"].asUUID()); // not necessarily an asset
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user