Backed out changeset 2827f31884f1

Used different approach to caching issues

--HG--
branch : Firestorm_2.4.2
master
Arrehn 2011-03-21 17:24:35 -04:00
parent bae436d78e
commit ee113bed4e
3 changed files with 9 additions and 41 deletions

View File

@ -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())

View File

@ -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;

View File

@ -235,11 +235,11 @@ std::string appendTime()
void LLNearbyChat::addMessage(const LLChat& chat,bool archive,const LLSD &args)
{
LLChat& tmp_chat = const_cast<LLChat&>(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)
{