diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-10-20 12:18:33 -0400 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-10-20 12:18:33 -0400 |
commit | 76876538715e3afbe456e2bf84173bde416d50e6 (patch) | |
tree | 423b27e9a5ef5c463b066b0fb5a50bda25060869 /indra/newview/llvoicevivox.cpp | |
parent | 0682e10532e058462d2bb1d5379c55d0e4d757e9 (diff) | |
parent | 04425000ae60b1fccf4feac1d4d84796d3b6b27d (diff) |
Automated merge up from viewer-development
Diffstat (limited to 'indra/newview/llvoicevivox.cpp')
-rw-r--r-- | indra/newview/llvoicevivox.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 350435078d..03e2da28b5 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -31,6 +31,8 @@ #include "llsdutil.h" +// Linden library includes +#include "llavatarnamecache.h" #include "llvoavatarself.h" #include "llbufferstream.h" #include "llfile.h" @@ -46,6 +48,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" @@ -2807,12 +2811,16 @@ void LLVivoxVoiceClient::buildLocalAudioUpdates(std::ostringstream &stream) void LLVivoxVoiceClient::checkFriend(const LLUUID& id) { - std::string name; buddyListEntry *buddy = findBuddy(id); // Make sure we don't add a name before it's been looked up. - if(gCacheName->getFullName(id, name)) + LLAvatarName av_name; + if(LLAvatarNameCache::get(id, &av_name)) { + // *NOTE: For now, we feed legacy names to Vivox because I don't know + // if their service can support a mix of new and old clients with + // different sorts of names. + std::string name = av_name.getLegacyName(); const LLRelationship* relationInfo = LLAvatarTracker::instance().getBuddyInfo(id); bool canSeeMeOnline = false; @@ -6364,16 +6372,18 @@ void LLVivoxVoiceClient::notifyFriendObservers() void LLVivoxVoiceClient::lookupName(const LLUUID &id) { - BOOL is_group = FALSE; - gCacheName->get(id, is_group, &LLVivoxVoiceClient::onAvatarNameLookup); + LLAvatarNameCache::get(id, + boost::bind(&LLVivoxVoiceClient::onAvatarNameCache, + this, _1, _2)); } -//static -void LLVivoxVoiceClient::onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) +void LLVivoxVoiceClient::onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name) { - std::string name = llformat("%s %s", first.c_str(), last.c_str()); - 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) |