diff options
| author | Andrew A. de Laix <alain@lindenlab.com> | 2010-11-02 15:59:24 -0700 |
|---|---|---|
| committer | Andrew A. de Laix <alain@lindenlab.com> | 2010-11-02 15:59:24 -0700 |
| commit | 0f6c3a167850a34bad9982ed29eb25c141845320 (patch) | |
| tree | 800d474cce6f33a1eb05a6838802235aff58a83e /indra/newview/llimview.cpp | |
| parent | be151807222ffa5972256aa9a392e8a319eae5ee (diff) | |
| parent | 9cc290ef8fccdc585027d84ac9cfb864ed933061 (diff) | |
Merge
Diffstat (limited to 'indra/newview/llimview.cpp')
| -rw-r--r-- | indra/newview/llimview.cpp | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index fe8a46e908..914e7a3df0 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -430,8 +430,9 @@ void LLIMModel::LLIMSession::addMessagesFromHistory(const std::list<LLSD>& histo } else { - // Legacy chat logs only wrote the legacy name, not the agent_id - gCacheName->getUUID(from, from_id); + // convert it to a legacy name if we have a complete name + std::string legacy_name = gCacheName->buildLegacyName(from); + gCacheName->getUUID(legacy_name, from_id); } std::string timestamp = msg[IM_TIME]; @@ -526,8 +527,16 @@ bool LLIMModel::LLIMSession::isOtherParticipantAvaline() void LLIMModel::LLIMSession::onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name) { - // if username is empty, display names isn't enabled, use the display name - mHistoryFileName = av_name.mUsername.empty() ? av_name.mDisplayName : av_name.mUsername; + if (av_name.mLegacyFirstName.empty()) + { + // if mLegacyFirstName is empty it means display names is off and the + // data came from the gCacheName, mDisplayName will be the legacy name + mHistoryFileName = LLCacheName::cleanFullName(av_name.mDisplayName); + } + else + { + mHistoryFileName = LLCacheName::cleanFullName(av_name.getLegacyName()); + } } void LLIMModel::LLIMSession::buildHistoryFileName() @@ -737,8 +746,18 @@ bool LLIMModel::addToHistory(const LLUUID& session_id, const std::string& from, bool LLIMModel::logToFile(const std::string& file_name, const std::string& from, const LLUUID& from_id, const std::string& utf8_text) { if (gSavedPerAccountSettings.getBOOL("LogInstantMessages")) - { - LLLogChat::saveHistory(file_name, from, from_id, utf8_text); + { + std::string from_name = from; + + LLAvatarName av_name; + if (!from_id.isNull() && + LLAvatarNameCache::get(from_id, &av_name) && + !av_name.mIsDisplayNameDefault) + { + from_name = av_name.getCompleteName(); + } + + LLLogChat::saveHistory(file_name, from_name, from_id, utf8_text); return true; } else |
