summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2010-05-17 16:33:16 -0700
committerJames Cook <james@lindenlab.com>2010-05-17 16:33:16 -0700
commit118ab8900a7ddc86564a84d836f507d4a1aa86b7 (patch)
tree1b881e52a54772bbd67bb51c1549293cb3935eff
parent40adb9599cd7eac1fd8062e4629a0e8b8c031638 (diff)
DEV-50013 Display name for inbound voice calls
(Last commit was actually for outbound). Reviewed with Leyla
-rw-r--r--indra/newview/llimview.cpp29
-rw-r--r--indra/newview/llimview.h9
-rw-r--r--indra/newview/llvoicevivox.cpp9
-rw-r--r--indra/newview/skins/default/xui/en/floater_incoming_call.xml2
4 files changed, 41 insertions, 8 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 23ad308a82..b17dca68f6 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -1915,21 +1915,21 @@ BOOL LLIncomingCallDialog::postBuild()
if (caller_name == "anonymous")
{
caller_name = getString("anonymous");
+ setCallerName(caller_name, caller_name, call_type);
}
else if (!is_avatar)
{
caller_name = LLTextUtil::formatPhoneNumber(caller_name);
+ setCallerName(caller_name, caller_name, call_type);
}
else
{
- // IDEVO
- caller_name = LLCacheName::cleanFullName(caller_name);
+ // Get the full name information
+ LLAvatarNameCache::get(caller_id,
+ boost::bind(&LLIncomingCallDialog::onAvatarNameCache,
+ this, _1, _2, call_type));
}
- setTitle(caller_name + " " + call_type);
-
- LLUICtrl* caller_name_widget = getChild<LLUICtrl>("caller name");
- caller_name_widget->setValue(caller_name + " " + call_type);
setIcon(session_id, caller_id);
childSetAction("Accept", onAccept, this);
@@ -1953,6 +1953,23 @@ BOOL LLIncomingCallDialog::postBuild()
return TRUE;
}
+void LLIncomingCallDialog::setCallerName(const std::string& ui_title,
+ const std::string& ui_label,
+ const std::string& call_type)
+{
+ setTitle(ui_title + " " + call_type);
+
+ LLUICtrl* caller_name_widget = getChild<LLUICtrl>("caller name");
+ caller_name_widget->setValue(ui_label + " " + call_type);
+}
+
+void LLIncomingCallDialog::onAvatarNameCache(const LLUUID& agent_id,
+ const LLAvatarName& av_name,
+ const std::string& call_type)
+{
+ std::string title = av_name.getNameAndSLID();
+ setCallerName(title, av_name.mDisplayName, call_type);
+}
void LLIncomingCallDialog::onOpen(const LLSD& key)
{
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index 758ea667ef..c132ac328f 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -41,7 +41,7 @@
#include "llvoicechannel.h"
-
+class LLAvatarName;
class LLFriendObserver;
class LLCallDialogManager;
class LLIMSpeakerMgr;
@@ -540,6 +540,13 @@ public:
static void onStartIM(void* user_data);
private:
+ void setCallerName(const std::string& ui_title,
+ const std::string& ui_label,
+ const std::string& call_type);
+ void onAvatarNameCache(const LLUUID& agent_id,
+ const LLAvatarName& av_name,
+ const std::string& call_type);
+
/*virtual*/ void onLifetimeExpired();
void processCallResponse(S32 response);
};
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index a457bd1fe6..4a0b0f12a4 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -37,6 +37,8 @@
#include "llsdutil.h"
+// Linden library includes
+#include "llavatarnamecache.h"
#include "llvoavatarself.h"
#include "llbufferstream.h"
#include "llfile.h"
@@ -52,6 +54,8 @@
#include "llviewercontrol.h"
#include "llkeyboard.h"
#include "llappviewer.h" // for gDisconnected, gDisableVoice
+
+// Viewer includes
#include "llmutelist.h" // to check for muted avatars
#include "llagent.h"
#include "llcachename.h"
@@ -6178,6 +6182,11 @@ 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);
}
//static
diff --git a/indra/newview/skins/default/xui/en/floater_incoming_call.xml b/indra/newview/skins/default/xui/en/floater_incoming_call.xml
index 1d67123726..420ba172e8 100644
--- a/indra/newview/skins/default/xui/en/floater_incoming_call.xml
+++ b/indra/newview/skins/default/xui/en/floater_incoming_call.xml
@@ -8,7 +8,7 @@
layout="topleft"
name="incoming call"
help_topic="incoming_call"
- title="UNKNOWN PERSON IS CALLING"
+ title="Incoming call"
width="410">
<floater.string
name="lifetime">