Fix display of SLID-only accounts - prototype display name code was

putting duplicate name in parentheses.
meow-7.2.2
James Cook 2010-02-16 11:58:21 -08:00
parent b34225a191
commit 65d388d162
2 changed files with 25 additions and 17 deletions

View File

@ -145,14 +145,15 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name)
return true;
}
std::string full_name;
if (gCacheName->getFullName(agent_id, full_name))
{
av_name->mSLID = slid_from_full_name(full_name);
av_name->mDisplayName = full_name;
av_name->mBadge = "Generic_Person";
return true;
}
// JAMESDEBUG Enable when we turn on display names.
//std::string full_name;
//if (gCacheName->getFullName(agent_id, full_name))
//{
// av_name->mSLID = slid_from_full_name(full_name);
// av_name->mDisplayName = full_name;
// av_name->mBadge = "Generic_Person";
// return true;
//}
return false;
}

View File

@ -326,12 +326,18 @@ void LLUrlEntryAgent::onNameCache(const LLUUID& id,
{
// IDEVO demo code
LLAvatarName av_name;
LLAvatarNameCache::get(id, &av_name);
std::string label = av_name.mDisplayName + " (" + av_name.mSLID + ")";
// use custom icon if available
std::string icon = (!av_name.mBadge.empty() ? av_name.mBadge : mIcon);
// received the agent name from the server - tell our observers
callObservers(id.asString(), label, icon);
if (LLAvatarNameCache::get(id, &av_name))
{
std::string label = av_name.mDisplayName + " (" + av_name.mSLID + ")";
// use custom icon if available
std::string icon = (!av_name.mBadge.empty() ? av_name.mBadge : mIcon);
// received the agent name from the server - tell our observers
callObservers(id.asString(), label, icon);
}
else
{
callObservers(id.asString(), full_name, mIcon);
}
}
std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
@ -358,9 +364,10 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa
else if (gCacheName->getFullName(agent_id, full_name))
{
LLAvatarName av_name;
LLAvatarNameCache::get(agent_id, &av_name);
std::string label = av_name.mDisplayName + " (" + av_name.mSLID + ")";
return label;
if (LLAvatarNameCache::get(agent_id, &av_name))
return av_name.mDisplayName + " (" + av_name.mSLID + ")";
else
return full_name;
}
else
{