DEV-50013 Convert call dialogs to use Display Names

Reviewed with Leyla
meow-7.2.2
James Cook 2010-05-20 15:30:59 -07:00
parent e47249777b
commit c994a93ed1
3 changed files with 18 additions and 22 deletions

View File

@ -1749,7 +1749,7 @@ void LLOutgoingCallDialog::show(const LLSD& key)
// Beautification: Since SLID is in the title bar, and you probably
// recognize this person's voice, just show display name
std::string final_callee_name = callee_name;
if (is_avatar)
if (mPayload["session_type"].asInteger() == LLIMModel::LLIMSession::P2P_SESSION)
{
LLAvatarName av_name;
if (LLAvatarNameCache::get(callee_id, &av_name))
@ -1957,8 +1957,9 @@ void LLIncomingCallDialog::setCallerName(const std::string& ui_title,
const std::string& ui_label,
const std::string& call_type)
{
setTitle(ui_title + " " + call_type);
setTitle(ui_title);
// call_type may be a string like " is calling."
LLUICtrl* caller_name_widget = getChild<LLUICtrl>("caller name");
caller_name_widget->setValue(ui_label + " " + call_type);
}
@ -2068,15 +2069,11 @@ void LLIncomingCallDialog::processCallResponse(S32 response)
}
else
{
if (gCacheName->getFullName(caller_id, correct_session_name))
// *NOTE: really should be using callbacks here
LLAvatarName av_name;
if (LLAvatarNameCache::get(caller_id, &av_name))
{
// IDEVO really should be using callbacks here
LLAvatarName av_name;
if (LLAvatarNameCache::useDisplayNames()
&& LLAvatarNameCache::get(caller_id, &av_name))
{
correct_session_name = av_name.mDisplayName + " (" + av_name.mUsername + ")";
}
correct_session_name = av_name.mDisplayName + " (" + av_name.mUsername + ")";
correct_session_name.append(ADHOC_NAME_SUFFIX);
}
}

View File

@ -6180,19 +6180,18 @@ void LLVivoxVoiceClient::notifyFriendObservers()
void LLVivoxVoiceClient::lookupName(const LLUUID &id)
{
BOOL is_group = FALSE;
gCacheName->get(id, is_group, &LLVivoxVoiceClient::onAvatarNameLookup);
// Peformance boost: We're going to need the display name later when
// we show the call request floater, so get the request going now
LLAvatarName unused;
LLAvatarNameCache::get(id, &unused);
LLAvatarNameCache::get(id,
boost::bind(&LLVivoxVoiceClient::onAvatarNameCache,
this, _1, _2));
}
//static
void LLVivoxVoiceClient::onAvatarNameLookup(const LLUUID& id, const std::string& name, BOOL is_group)
void LLVivoxVoiceClient::onAvatarNameCache(const LLUUID& agent_id,
const LLAvatarName& av_name)
{
LLVivoxVoiceClient::getInstance()->avatarNameResolved(id, name);
// For Vivox, we use the legacy name because I'm uncertain whether or
// not their service can tolerate switching to Username or Display Name
std::string legacy_name = av_name.getLegacyName();
avatarNameResolved(agent_id, legacy_name);
}
void LLVivoxVoiceClient::avatarNameResolved(const LLUUID &id, const std::string &name)

View File

@ -51,7 +51,7 @@ class LLVivoxProtocolParser;
#endif
#include "llvoiceclient.h"
class LLAvatarName;
class LLVivoxVoiceAccountProvisionResponder;
class LLVivoxVoiceClientMuteListObserver;
class LLVivoxVoiceClientFriendsObserver;
@ -619,7 +619,7 @@ protected:
void leaveAudioSession();
void lookupName(const LLUUID &id);
static void onAvatarNameLookup(const LLUUID& id, const std::string& name, BOOL is_group);
void onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name);
void avatarNameResolved(const LLUUID &id, const std::string &name);
private: