From 40a6786af669cd8ed030d1e6f0de43d98492f98a Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Wed, 8 Sep 2010 16:39:25 -0700 Subject: Fixing chat logs to use username --- indra/newview/llimview.cpp | 11 +++++++++++ indra/newview/llimview.h | 2 ++ 2 files changed, 13 insertions(+) (limited to 'indra') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 070e384fa4..7109f9e21e 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -518,6 +518,11 @@ bool LLIMModel::LLIMSession::isOtherParticipantAvaline() return !mOtherParticipantIsAvatar; } +void LLIMModel::LLIMSession::onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name) +{ + mHistoryFileName = av_name.mUsername; +} + void LLIMModel::LLIMSession::buildHistoryFileName() { mHistoryFileName = mName; @@ -536,6 +541,12 @@ void LLIMModel::LLIMSession::buildHistoryFileName() //in case of incoming ad-hoc sessions mHistoryFileName = mName + " " + LLLogChat::timestamp(true) + " " + mSessionID.asString().substr(0, 4); } + + // look up username to use as the log name + if (isP2P()) + { + LLAvatarNameCache::get(mOtherParticipantID, boost::bind(&LLIMModel::LLIMSession::onAvatarNameCache, this, _1, _2)); + } } //static diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index c95f98f552..d566a4d03f 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -97,6 +97,8 @@ public: /** ad-hoc sessions involve sophisticated chat history file naming schemes */ void buildHistoryFileName(); + void onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name); + //*TODO make private static std::string generateHash(const std::set& sorted_uuids); -- cgit v1.2.3