diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 40088c63de..9f3be05d99 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -695,19 +695,6 @@ void LLChatHistory::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName mDisplayName_Username = mDisplayName + " ("+av_name.mUsername+")"; } -//-TT Display names timing in chat -void LLChatHistory::lookupDisplayNames(const LLChat& chat) -{ - // resolve display names if necessary - if (gSavedSettings.getBOOL("UseDisplayNames")) - { - mDisplayName=chat.mFromName; - mDisplayName_Username=chat.mFromName; - LLAvatarNameCache::get(chat.mFromID,boost::bind(&LLChatHistory::onAvatarNameCache, this, _1, _2)); - } -} -//-TT - void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LLStyle::Params& input_append_params) { @@ -716,15 +703,13 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL //time to get an answer back before it's needed. if (use_plain_text_chat_history) { - lookupDisplayNames(chat); - //ms_sleep(250); - //// resolve display names if necessary - //if (gSavedSettings.getBOOL("UseDisplayNames")) - //{ - // mDisplayName=chat.mFromName; - // mDisplayName_Username=chat.mFromName; - // LLAvatarNameCache::get(chat.mFromID,boost::bind(&LLChatHistory::onAvatarNameCache, this, _1, _2)); - //} + // resolve display names if necessary + if (gSavedSettings.getBOOL("UseDisplayNames")) + { + mDisplayName=chat.mFromName; + mDisplayName_Username=chat.mFromName; + LLAvatarNameCache::get(chat.mFromID,boost::bind(&LLChatHistory::onAvatarNameCache, this, _1, _2)); + } } llassert(mEditor); @@ -878,12 +863,10 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL link_params.readonly_color(header_name_color); if ((gSavedSettings.getBOOL("NameTagShowUsernames")) && (gSavedSettings.getBOOL("UseDisplayNames"))) { - checkDisplayName(); mEditor->appendText(mDisplayName_Username, false, link_params); } else if (gSavedSettings.getBOOL("UseDisplayNames")) { - checkDisplayName(); mEditor->appendText(mDisplayName, false, link_params); } else @@ -1061,18 +1044,6 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL } } -bool LLChatHistory::checkDisplayName() -{ - for (int i = 0; i <=20; i++) - { - if (mDisplayName.empty()) - ms_sleep(50); - else - return true; - } - return false; -} - void LLChatHistory::draw() { if (mEditor->scrolledToEnd()) diff --git a/indra/newview/llchathistory.h b/indra/newview/llchathistory.h index fd4836a05d..efacf285ae 100644 --- a/indra/newview/llchathistory.h +++ b/indra/newview/llchathistory.h @@ -118,10 +118,7 @@ class LLChatHistory : public LLUICtrl */ void appendMessage(const LLChat& chat, const LLSD &args = LLSD(), const LLStyle::Params& input_append_params = LLStyle::Params()); /*virtual*/ void clear(); -//-TT Display names timing in chat - void lookupDisplayNames(const LLChat& chat); - bool checkDisplayName(); -//-TT + private: std::string mLastFromName; LLUUID mLastFromID; diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index dd499f4339..bd18905a9c 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -235,11 +235,11 @@ std::string appendTime() void LLNearbyChat::addMessage(const LLChat& chat,bool archive,const LLSD &args) { LLChat& tmp_chat = const_cast(chat); - bool use_plain_text_chat_history = gSavedSettings.getBOOL("PlainTextChatHistory"); if(tmp_chat.mTimeStr.empty()) tmp_chat.mTimeStr = appendTime(); + bool use_plain_text_chat_history = gSavedSettings.getBOOL("PlainTextChatHistory"); if (!chat.mMuted) {