From 4d23288e052a9bbe329a37eba2984f71d9892e7d Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 7 May 2015 19:43:59 +0200 Subject: [PATCH] FIRE-10278: Show correct voice volume in Nearby Voice if we have a stored volume --- indra/newview/llavatarlistitem.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 6fa92ed7b6..1b1cfd4fbb 100755 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -377,6 +377,27 @@ void LLAvatarListItem::setAvatarId(const LLUUID& id, const LLUUID& session_id, b mAvatarId = id; mSpeakingIndicator->setSpeakerId(id, session_id); + // FIRE-10278: Show correct voice volume if we have it stored + if (LLVoiceClient::getInstance()->getVoiceEnabled(mAvatarId)) + { + bool is_muted = LLAvatarActions::isVoiceMuted(mAvatarId); + + F32 volume; + if (is_muted) + { + // it's clearer to display their volume as zero + volume = 0.f; + } + else + { + // actual volume + volume = LLVoiceClient::getInstance()->getUserVolume(mAvatarId); + } + mVoiceSlider->setValue((F64)volume); + } + // + + // We'll be notified on avatar online status changes if (!ignore_status_changes && mAvatarId.notNull()) LLAvatarTracker::instance().addParticularFriendObserver(mAvatarId, this);