From 3a8053eb9fc0db52b9fb5ae02f1807acbb4e072d Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 11 Feb 2019 19:01:28 +0200 Subject: SL-10351 Fixed Avatars muted by Group moderator become Blocked forever --- indra/newview/lloutputmonitorctrl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/lloutputmonitorctrl.cpp') diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index 6c26073d5b..c5e4593b79 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -72,6 +72,7 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p) mImageLevel3(p.image_level_3), mAutoUpdate(p.auto_update), mSpeakerId(p.speaker_id), + mIsModeratorMuted(false), mIsAgentControl(false), mIndicatorToggled(false), mShowParticipantsSpeaking(false) @@ -124,7 +125,7 @@ void LLOutputMonitorCtrl::draw() const F32 LEVEL_1 = LLVoiceClient::OVERDRIVEN_POWER_LEVEL * 2.f / 3.f; const F32 LEVEL_2 = LLVoiceClient::OVERDRIVEN_POWER_LEVEL; - if (getVisible() && mAutoUpdate && !mIsMuted && mSpeakerId.notNull()) + if (getVisible() && mAutoUpdate && !getIsMuted() && mSpeakerId.notNull()) { setPower(LLVoiceClient::getInstance()->getCurrentPower(mSpeakerId)); if(mIsAgentControl) @@ -156,7 +157,7 @@ void LLOutputMonitorCtrl::draw() } LLPointer icon; - if (mIsMuted) + if (getIsMuted()) { icon = mImageMute; } -- cgit v1.3 From 3b3e4833ad41993785ea2fcae651b588df8e492d Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 5 Mar 2019 20:14:21 +0200 Subject: SL-10686 Refresh indicators on session change, fix visibility --- indra/newview/llconversationview.cpp | 55 ++++++++++++++++++++--------------- indra/newview/llconversationview.h | 3 +- indra/newview/lloutputmonitorctrl.cpp | 14 +++++++-- indra/newview/lloutputmonitorctrl.h | 5 +++- 4 files changed, 50 insertions(+), 27 deletions(-) (limited to 'indra/newview/lloutputmonitorctrl.cpp') diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 59bb9af744..0075b62100 100644 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -440,28 +440,23 @@ void LLConversationViewSession::refresh() LLSpeakingIndicatorManager::updateSpeakingIndicators(); // we should show indicator for specified voice session only if this is current channel. EXT-5562. - if (!mIsInActiveVoiceChannel) + if (mSpeakingIndicator) { - if (mSpeakingIndicator) + mSpeakingIndicator->setIsActiveChannel(mIsInActiveVoiceChannel); + mSpeakingIndicator->setShowParticipantsSpeaking(mIsInActiveVoiceChannel); + } + + LLConversationViewParticipant* participant = NULL; + items_t::const_iterator iter; + for (iter = getItemsBegin(); iter != getItemsEnd(); iter++) + { + participant = dynamic_cast(*iter); + if (participant) { - mSpeakingIndicator->setVisible(false); - } - LLConversationViewParticipant* participant = NULL; - items_t::const_iterator iter; - for (iter = getItemsBegin(); iter != getItemsEnd(); iter++) - { - participant = dynamic_cast(*iter); - if (participant) - { - participant->hideSpeakingIndicator(); - } + participant->allowSpeakingIndicator(mIsInActiveVoiceChannel); } } - - if (mSpeakingIndicator) - { - mSpeakingIndicator->setShowParticipantsSpeaking(mIsInActiveVoiceChannel); - } + requestArrange(); // Do the regular upstream refresh LLFolderViewFolder::refresh(); @@ -473,8 +468,13 @@ void LLConversationViewSession::onCurrentVoiceSessionChanged(const LLUUID& sessi if (vmi) { + bool old_value = mIsInActiveVoiceChannel; mIsInActiveVoiceChannel = vmi->getUUID() == session_id; mCallIconLayoutPanel->setVisible(mIsInActiveVoiceChannel); + if (old_value != mIsInActiveVoiceChannel) + { + refresh(); + } } } @@ -630,10 +630,19 @@ void LLConversationViewParticipant::addToFolder(LLFolderViewFolder* folder) LLFolderViewItem::addToFolder(folder); // Retrieve the folder (conversation) UUID, which is also the speaker session UUID - LLConversationItem* vmi = getParentFolder() ? dynamic_cast(getParentFolder()->getViewModelItem()) : NULL; - if (vmi) + LLFolderViewFolder *prnt = getParentFolder(); + if (prnt) { - addToSession(vmi->getUUID()); + LLConversationItem* vmi = dynamic_cast(prnt->getViewModelItem()); + if (vmi) + { + addToSession(vmi->getUUID()); + } + LLConversationViewSession* session = dynamic_cast(prnt); + if (session) + { + allowSpeakingIndicator(session->isInActiveVoiceChannel()); + } } } @@ -763,9 +772,9 @@ LLView* LLConversationViewParticipant::getItemChildView(EAvatarListItemChildInde return child_view; } -void LLConversationViewParticipant::hideSpeakingIndicator() +void LLConversationViewParticipant::allowSpeakingIndicator(bool val) { - mSpeakingIndicator->setVisible(false); + mSpeakingIndicator->setIsActiveChannel(val); } // EOF diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h index 06ffb517bb..420c250dfe 100644 --- a/indra/newview/llconversationview.h +++ b/indra/newview/llconversationview.h @@ -90,6 +90,7 @@ public: void setHighlightState(bool hihglight_state); LLFloater* getSessionFloater(); + bool isInActiveVoiceChannel() { return mIsInActiveVoiceChannel; } private: @@ -145,7 +146,7 @@ public: /*virtual*/ S32 getLabelXPos(); /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask ); - void hideSpeakingIndicator(); + void allowSpeakingIndicator(bool val); protected: friend class LLUICtrlFactory; diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index c5e4593b79..a873ccf98b 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -74,6 +74,7 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p) mSpeakerId(p.speaker_id), mIsModeratorMuted(false), mIsAgentControl(false), + mIsActiveChannel(false), mIndicatorToggled(false), mShowParticipantsSpeaking(false) { @@ -256,6 +257,16 @@ BOOL LLOutputMonitorCtrl::handleMouseUp(S32 x, S32 y, MASK mask) return TRUE; } +void LLOutputMonitorCtrl::setIsActiveChannel(bool val) +{ + mIsActiveChannel = val; + if (!val) + { + // switchIndicator will set it to TRUE when channel becomes active + setVisible(FALSE); + } +} + void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id, const LLUUID& session_id/* = LLUUID::null*/, bool show_other_participants_speaking /* = false */) { if (speaker_id.isNull() && mSpeakerId.notNull()) @@ -305,8 +316,7 @@ void LLOutputMonitorCtrl::onChange() // virtual void LLOutputMonitorCtrl::switchIndicator(bool switch_on) { - - if(getVisible() != (BOOL)switch_on) + if (mIsActiveChannel && getVisible() != (BOOL)switch_on) { setVisible(switch_on); diff --git a/indra/newview/lloutputmonitorctrl.h b/indra/newview/lloutputmonitorctrl.h index af52a81b04..307cd30ab3 100644 --- a/indra/newview/lloutputmonitorctrl.h +++ b/indra/newview/lloutputmonitorctrl.h @@ -79,9 +79,11 @@ public: // For the current user, need to know the PTT state to show // correct button image. void setIsAgentControl(bool val) { mIsAgentControl = val; } - void setIsTalking(bool val) { mIsTalking = val; } + // switchIndicator controls visibility, 'active channel' governs if we are allowed to show indicator + void setIsActiveChannel(bool val); + void setShowParticipantsSpeaking(bool show) { mShowParticipantsSpeaking = show; } /** @@ -137,6 +139,7 @@ private: bool mIsModeratorMuted; bool mIsMuted; bool mIsTalking; + bool mIsActiveChannel; bool mShowParticipantsSpeaking; LLPointer mImageMute; LLPointer mImageOff; -- cgit v1.3 From e4b499e64d63dbcdb97590f86d533f6877690b84 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Fri, 22 Mar 2019 17:31:26 +0200 Subject: SL-10780 FIXED Speaker icon is shown for all friends --- indra/newview/llavatarlistitem.cpp | 1 + indra/newview/lloutputmonitorctrl.cpp | 15 ++++++++++----- indra/newview/lloutputmonitorctrl.h | 11 ++++++++++- 3 files changed, 21 insertions(+), 6 deletions(-) (limited to 'indra/newview/lloutputmonitorctrl.cpp') diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index af3fac91bc..396b69ae3a 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -119,6 +119,7 @@ BOOL LLAvatarListItem::postBuild() mIconPermissionEditTheirs->setVisible(false); mSpeakingIndicator = getChild("speaking_indicator"); + mSpeakingIndicator->setChannelState(LLOutputMonitorCtrl::UNDEFINED_CHANNEL); mInfoBtn = getChild("info_btn"); mProfileBtn = getChild("profile_btn"); diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index a873ccf98b..7f6c065bb9 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -74,9 +74,9 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p) mSpeakerId(p.speaker_id), mIsModeratorMuted(false), mIsAgentControl(false), - mIsActiveChannel(false), mIndicatorToggled(false), - mShowParticipantsSpeaking(false) + mShowParticipantsSpeaking(false), + mChannelState(INACTIVE_CHANNEL) { //static LLUIColor output_monitor_muted_color = LLUIColorTable::instance().getColor("OutputMonitorMutedColor", LLColor4::orange); //static LLUIColor output_monitor_overdriven_color = LLUIColorTable::instance().getColor("OutputMonitorOverdrivenColor", LLColor4::red); @@ -259,8 +259,13 @@ BOOL LLOutputMonitorCtrl::handleMouseUp(S32 x, S32 y, MASK mask) void LLOutputMonitorCtrl::setIsActiveChannel(bool val) { - mIsActiveChannel = val; - if (!val) + setChannelState(val ? ACTIVE_CHANNEL : INACTIVE_CHANNEL); +} + +void LLOutputMonitorCtrl::setChannelState(EChannelState state) +{ + mChannelState = state; + if (state == INACTIVE_CHANNEL) { // switchIndicator will set it to TRUE when channel becomes active setVisible(FALSE); @@ -316,7 +321,7 @@ void LLOutputMonitorCtrl::onChange() // virtual void LLOutputMonitorCtrl::switchIndicator(bool switch_on) { - if (mIsActiveChannel && getVisible() != (BOOL)switch_on) + if ((mChannelState != INACTIVE_CHANNEL) && (getVisible() != (BOOL)switch_on)) { setVisible(switch_on); diff --git a/indra/newview/lloutputmonitorctrl.h b/indra/newview/lloutputmonitorctrl.h index 307cd30ab3..98966d39ee 100644 --- a/indra/newview/lloutputmonitorctrl.h +++ b/indra/newview/lloutputmonitorctrl.h @@ -81,8 +81,16 @@ public: void setIsAgentControl(bool val) { mIsAgentControl = val; } void setIsTalking(bool val) { mIsTalking = val; } + enum EChannelState + { + ACTIVE_CHANNEL, + INACTIVE_CHANNEL, + UNDEFINED_CHANNEL + }; + // switchIndicator controls visibility, 'active channel' governs if we are allowed to show indicator void setIsActiveChannel(bool val); + void setChannelState(EChannelState state); void setShowParticipantsSpeaking(bool show) { mShowParticipantsSpeaking = show; } @@ -139,7 +147,6 @@ private: bool mIsModeratorMuted; bool mIsMuted; bool mIsTalking; - bool mIsActiveChannel; bool mShowParticipantsSpeaking; LLPointer mImageMute; LLPointer mImageOff; @@ -155,6 +162,8 @@ private: LLUUID mSpeakerId; bool mIndicatorToggled; + + EChannelState mChannelState; }; #endif -- cgit v1.3