diff options
author | Leyla Farazha <leyla@lindenlab.com> | 2010-09-13 14:59:31 -0700 |
---|---|---|
committer | Leyla Farazha <leyla@lindenlab.com> | 2010-09-13 14:59:31 -0700 |
commit | a923da7fc78b44cd5368d26652b0204322f064a4 (patch) | |
tree | 57c9820872c0d14c919a9d8ccc4f226b6b4c6f70 /indra/newview/llcallfloater.cpp | |
parent | 7ca63c963dd6a3015b580ef73e27f3ebb9ebb837 (diff) |
DEV-52931 Toggling "View Display Names" doesn't take effect right away in the Friends list
Diffstat (limited to 'indra/newview/llcallfloater.cpp')
-rw-r--r-- | indra/newview/llcallfloater.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index c0babc6851..bf976f6b66 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -114,6 +114,9 @@ LLCallFloater::LLCallFloater(const LLSD& key) // force docked state since this floater doesn't save it between recreations setDocked(true); + + // update the agent's name if display name setting change + LLAvatarNameCache::addUseDisplayNamesCallback(boost::bind(&LLCallFloater::updateAgentModeratorState, this)); } LLCallFloater::~LLCallFloater() @@ -460,15 +463,12 @@ void LLCallFloater::setModeratorMutedVoice(bool moderator_muted) mSpeakingIndicator->setIsMuted(moderator_muted); } -void LLCallFloater::updateAgentModeratorState() +void LLCallFloater::onModeratorNameCache(const LLAvatarName& av_name) { std::string name; - // Just use display name, because it's you - LLAvatarName av_name; - LLAvatarNameCache::get(gAgentID, &av_name); name = av_name.mDisplayName; - if(gAgent.isInGroup(mSpeakerManager->getSessionID())) + if(mSpeakerManager && gAgent.isInGroup(mSpeakerManager->getSessionID())) { // This method can be called when LLVoiceChannel.mState == STATE_NO_CHANNEL_INFO // in this case there are not any speakers yet. @@ -486,6 +486,11 @@ void LLCallFloater::updateAgentModeratorState() mAgentPanel->getChild<LLUICtrl>("user_text")->setValue(name); } +void LLCallFloater::updateAgentModeratorState() +{ + LLAvatarNameCache::get(gAgentID, boost::bind(&LLCallFloater::onModeratorNameCache, this, _2)); +} + static void get_voice_participants_uuids(uuid_vec_t& speakers_uuids) { // Get a list of participants from VoiceClient |