summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-10-26 11:34:41 -0400
committerLoren Shih <seraph@lindenlab.com>2010-10-26 11:34:41 -0400
commit40689e5b325d2f31c45b377effe6334f0b37c5f2 (patch)
tree7f8048ddaf3971ff1dddfd0c2e6b3e8fde61e734 /indra/newview/llimview.cpp
parentaf57ff75dea16ed857c27ebfa288b9881668e9ac (diff)
parenta40a2a7a465f6e03ca495c301dfbf7bfa376be30 (diff)
Automated merge up from viewer-development
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r--indra/newview/llimview.cpp31
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