FIRE-15138: Sharing inventory item sometimes doesn't obey UseLegacyIMLogNames setting

Fri, 15 Apr 2016 16:05:57 +0200

author
Ansariel
date
Fri, 15 Apr 2016 16:05:57 +0200
changeset 48944
32e8b304bc22
parent 48943
d14bdd999e78
child 48945
8e3e37734f4b

FIRE-15138: Sharing inventory item sometimes doesn't obey UseLegacyIMLogNames setting

indra/newview/llimview.cpp file | annotate | diff | revisions
     1.1 --- a/indra/newview/llimview.cpp	Thu Apr 07 16:57:55 2016 +0200
     1.2 +++ b/indra/newview/llimview.cpp	Fri Apr 15 16:05:57 2016 +0200
     1.3 @@ -3192,6 +3192,25 @@
     1.4      }
     1.5  }
     1.6  
     1.7 +// <FS:Ansariel> FIRE-15138: Sharing inventory item sometimes doesn't obey UseLegacyIMLogNames setting
     1.8 +void add_system_message_name_cb(LLAvatarName avatar_name, const std::string& message)
     1.9 +{
    1.10 +	std::string session_name = avatar_name.getLegacyName();
    1.11 +
    1.12 +	// <FS:Ansariel> [Legacy IM logfile names]
    1.13 +	if (gSavedSettings.getBOOL("UseLegacyIMLogNames"))
    1.14 +	{
    1.15 +		session_name = session_name.substr(0, session_name.find(" Resident"));;
    1.16 +	}
    1.17 +	else
    1.18 +	{
    1.19 +		session_name = LLCacheName::buildUsername(session_name);
    1.20 +	}
    1.21 +	// </FS:Ansariel> [Legacy IM logfile names]
    1.22 +	LLIMModel::instance().logToFile(session_name, SYSTEM_FROM, LLUUID::null, message);
    1.23 +}
    1.24 +// </FS:Ansariel>
    1.25 +
    1.26  void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& message_name, const LLSD& args)
    1.27  {
    1.28  	LLUIString message;
    1.29 @@ -3226,21 +3245,14 @@
    1.30  
    1.31  		else
    1.32  		{
    1.33 -			std::string session_name;
    1.34 -			// since we select user to share item with - his name is already in cache
    1.35 -			gCacheName->getFullName(args["user_id"], session_name);
    1.36 -			// <FS:Ansariel> [Legacy IM logfile names]
    1.37 +			// <FS:Ansariel> FIRE-15138: Sharing inventory item sometimes doesn't obey UseLegacyIMLogNames setting
    1.38 +			//std::string session_name;
    1.39 +			//// since we select user to share item with - his name is already in cache
    1.40 +			//gCacheName->getFullName(args["user_id"], session_name);
    1.41  			//session_name = LLCacheName::buildUsername(session_name);
    1.42 -			if (gSavedSettings.getBOOL("UseLegacyIMLogNames"))
    1.43 -			{
    1.44 -				session_name = session_name.substr(0, session_name.find(" Resident"));;
    1.45 -			}
    1.46 -			else
    1.47 -			{
    1.48 -				session_name = LLCacheName::buildUsername(session_name);
    1.49 -			}
    1.50 -			// </FS:Ansariel> [Legacy IM logfile names]
    1.51 -			LLIMModel::instance().logToFile(session_name, SYSTEM_FROM, LLUUID::null, message.getString());
    1.52 +			//LLIMModel::instance().logToFile(session_name, SYSTEM_FROM, LLUUID::null, message.getString());
    1.53 +			LLAvatarNameCache::get(args["user_id"].asUUID(), boost::bind(&add_system_message_name_cb, _2, message.getString()));
    1.54 +			// </FS:Ansariel>
    1.55  		}
    1.56  	}
    1.57  }

mercurial