diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index bc0813c34a..cb4617631d 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -159,6 +159,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 06919fc6da..96f2cdf63c 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -76,9 +76,9 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p) mSpeakerId(p.speaker_id), mIsModeratorMuted(false), mIsAgentControl(false), - mIsActiveChannel(false), mIndicatorToggled(false), mShowParticipantsSpeaking(false), + mChannelState(INACTIVE_CHANNEL), mAlwaysVisible(false) // Option to not hide it if speaker ID is set to null { //static LLUIColor output_monitor_muted_color = LLUIColorTable::instance().getColor("OutputMonitorMutedColor", LLColor4::orange); @@ -296,8 +296,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); @@ -356,7 +361,7 @@ void LLOutputMonitorCtrl::onChange() void LLOutputMonitorCtrl::switchIndicator(bool switch_on) { // [FS communication UI] - //if (mIsActiveChannel && getVisible() != (BOOL)switch_on) + //if ((mChannelState != INACTIVE_CHANNEL) && (getVisible() != (BOOL)switch_on)) if (getVisible() != (BOOL)switch_on) // [FS communication UI] { diff --git a/indra/newview/lloutputmonitorctrl.h b/indra/newview/lloutputmonitorctrl.h index 51fc618f03..0c4619422a 100644 --- a/indra/newview/lloutputmonitorctrl.h +++ b/indra/newview/lloutputmonitorctrl.h @@ -84,8 +84,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; } @@ -142,7 +150,6 @@ private: bool mIsModeratorMuted; bool mIsMuted; bool mIsTalking; - bool mIsActiveChannel; bool mShowParticipantsSpeaking; LLPointer mImageMute; LLPointer mImageOff; @@ -158,6 +165,8 @@ private: LLUUID mSpeakerId; bool mIndicatorToggled; + + EChannelState mChannelState; }; //////////////////////////////////////////////////////////////////////////