summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2010-10-25 12:08:58 -0700
committerMerov Linden <merov@lindenlab.com>2010-10-25 12:08:58 -0700
commit78f291a72217afd2cb88a8c15244441ca1bb8581 (patch)
tree8d012246511551e0fc69e5cbbf41e2e89c36b5fa /indra/newview/llimview.cpp
parentde6f7e19c44d267d3224c56941c2ab27677c406f (diff)
parente98eff02ae4894050267a6b302c4887393ff1244 (diff)
pull viewer-beta in 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