SL-9975 All offline inventory offers from scripted objects are lost

andreykproductengine 2018-11-14 17:15:11 +02:00
parent e867e619db
commit ab0d3f09d7
1 changed files with 25 additions and 7 deletions

View File

@ -854,15 +854,33 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
}
else // IM_TASK_INVENTORY_OFFERED
{
if (sizeof(S8) != binary_bucket_size)
if (offline == IM_OFFLINE && session_id.isNull() && aux_id.notNull() && binary_bucket_size > sizeof(S8)* 5)
{
LL_WARNS("Messaging") << "Malformed inventory offer from object" << LL_ENDL;
delete info;
break;
// cap received offline message
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
{
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;
}
info->mType = (LLAssetType::EType) binary_bucket[0];
info->mObjectID = LLUUID::null;
info->mFromObject = TRUE;
}
info->mIM = dialog;