Removed old display name lookup hack.

ziree 2012-04-05 16:47:12 +02:00
parent 943fd28d21
commit f5ff6ba43c
2 changed files with 10 additions and 43 deletions

View File

@ -775,22 +775,6 @@ void LLChatHistory::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName
mDisplayName_Username = av_name.getCompleteName();
}
//-TT Display names timing in chat
void LLChatHistory::lookupDisplayNames(const LLChat& chat)
{
// resolve display names if necessary
if (gSavedSettings.getBOOL("UseDisplayNames"))
{
if (chat.mSourceType == CHAT_SOURCE_AGENT)
{
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)
{
bool use_plain_text_chat_history = args["use_plain_text_chat_history"].asBoolean();
@ -799,15 +783,15 @@ 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));
//}
// make sure objects and agents always have at least something we can display as a name
mDisplayName=chat.mFromName;
mDisplayName_Username=chat.mFromName;
// resolve display names if necessary
if (chat.mSourceType == CHAT_SOURCE_AGENT && gSavedSettings.getBOOL("UseDisplayNames"))
{
LLAvatarNameCache::get(chat.mFromID,boost::bind(&LLChatHistory::onAvatarNameCache, this, _1, _2));
}
}
llassert(mEditor);
@ -991,12 +975,10 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
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
@ -1168,18 +1150,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

@ -119,10 +119,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;