FIRE-29943: Fix item shared messaged logging to wrong IM logfile if user is offline

master
Ansariel 2020-07-31 14:03:04 +02:00
parent 5733658f32
commit 0f4933e2fc
3 changed files with 20 additions and 2 deletions

View File

@ -1936,6 +1936,7 @@ void LLPostponedNotification::lookupName(const LLUUID& id,
}
else
{
mFromId = id; // <FS:Ansariel> FIRE-29943: Item shared messaged logging to wrong IM logfile if user is offline
fetchAvatarName(id);
}
}

View File

@ -1043,7 +1043,8 @@ protected:
LLPostponedNotification()
: mParams(),
mName(),
mAvatarNameCacheConnection()
mAvatarNameCacheConnection(),
mFromId(LLUUID::null) // <FS:Ansariel> FIRE-29943: Item shared messaged logging to wrong IM logfile if user is offline
{}
virtual ~LLPostponedNotification()
@ -1064,6 +1065,7 @@ protected:
LLNotification::Params mParams;
std::string mName;
boost::signals2::connection mAvatarNameCacheConnection;
LLUUID mFromId; // <FS:Ansariel> FIRE-29943: Item shared messaged logging to wrong IM logfile if user is offline
};
// Stores only persistent notifications.

View File

@ -183,7 +183,22 @@ protected:
void modifyNotificationParams()
{
LLSD payload = mParams.payload;
payload["SESSION_NAME"] = mName;
// <FS:Ansariel> FIRE-29943: Item shared messaged logging to wrong IM logfile if user is offline
//payload["SESSION_NAME"] = mName;
LLAvatarName av_name;
// This should work since modifyNotificationParams() is invoked after we already
// retrieved the avatar name
if (mFromId.notNull() && LLAvatarNameCache::instance().getName(mFromId, &av_name))
{
// LLHandlerUtil::logToIM() will transform this into the correct filename
payload["SESSION_NAME"] = av_name.getLegacyName();
}
else
{
payload["SESSION_NAME"] = mName;
}
// </FS:Ansariel>
mParams.payload = payload;
}
};