SL-10351 Fixed Avatars muted by Group moderator become Blocked forever

master
andreykproductengine 2019-02-11 19:01:28 +02:00
parent b31cd0a7e9
commit 3a8053eb9f
6 changed files with 30 additions and 5 deletions

View File

@ -351,7 +351,7 @@ void LLConversationItemSession::setParticipantIsMuted(const LLUUID& participant_
LLConversationItemParticipant* participant = findParticipant(participant_id);
if (participant)
{
participant->muteVoice(is_muted);
participant->moderateVoice(is_muted);
}
}
@ -498,6 +498,7 @@ void LLConversationItemSession::onAvatarNameCache(const LLAvatarName& av_name)
LLConversationItemParticipant::LLConversationItemParticipant(std::string display_name, const LLUUID& uuid, LLFolderViewModelInterface& root_view_model) :
LLConversationItem(display_name,uuid,root_view_model),
mIsModeratorMuted(false),
mIsModerator(false),
mDisplayModeratorLabel(false),
mDistToAgent(-1.0)
@ -508,6 +509,7 @@ LLConversationItemParticipant::LLConversationItemParticipant(std::string display
LLConversationItemParticipant::LLConversationItemParticipant(const LLUUID& uuid, LLFolderViewModelInterface& root_view_model) :
LLConversationItem(uuid,root_view_model),
mIsModeratorMuted(false),
mIsModerator(false),
mDisplayModeratorLabel(false),
mDistToAgent(-1.0)
@ -597,7 +599,7 @@ void LLConversationItemParticipant::setDisplayModeratorRole(bool displayRole)
bool LLConversationItemParticipant::isVoiceMuted()
{
return LLMuteList::getInstance()->isMuted(mUUID, LLMute::flagVoiceChat);
return mIsModeratorMuted || LLMuteList::getInstance()->isMuted(mUUID, LLMute::flagVoiceChat);
}
void LLConversationItemParticipant::muteVoice(bool mute_voice)

View File

@ -194,8 +194,10 @@ public:
virtual const std::string& getDisplayName() const { return mDisplayName; }
bool isVoiceMuted();
bool isModeratorMuted() { return mIsModeratorMuted; }
bool isModerator() const { return mIsModerator; }
void muteVoice(bool mute_voice);
void moderateVoice(bool mute_voice) { mIsModeratorMuted = mute_voice; }
void setIsModerator(bool is_moderator) { mIsModerator = is_moderator; mNeedsRefresh = true; }
void setTimeNow() { mLastActiveTime = LLFrameTimer::getElapsedSeconds(); mNeedsRefresh = true; }
void setDistance(F64 dist) { mDistToAgent = dist; mNeedsRefresh = true; }
@ -216,6 +218,7 @@ private:
void onAvatarNameCache(const LLAvatarName& av_name); // callback used by fetchAvatarName
void updateName(const LLAvatarName& av_name);
bool mIsModeratorMuted; // default is false
bool mIsModerator; // default is false
bool mDisplayModeratorLabel; // default is false
std::string mDisplayName;

View File

@ -605,6 +605,20 @@ S32 LLConversationViewParticipant::arrange(S32* width, S32* height)
return arranged;
}
// virtual
void LLConversationViewParticipant::refresh()
{
// Refresh the participant view from its model data
LLConversationItemParticipant* participant_model = dynamic_cast<LLConversationItemParticipant*>(getViewModelItem());
participant_model->resetRefresh();
// *TODO: We should also do something with vmi->isModerator() to echo that state in the UI somewhat
mSpeakingIndicator->setIsModeratorMuted(participant_model->isModeratorMuted());
// Do the regular upstream refresh
LLFolderViewItem::refresh();
}
void LLConversationViewParticipant::addToFolder(LLFolderViewFolder* folder)
{
// Add the item to the folder (conversation)

View File

@ -136,6 +136,7 @@ public:
virtual ~LLConversationViewParticipant( void );
bool hasSameValue(const LLUUID& uuid) { return (uuid == mUUID); }
/*virtual*/ void refresh();
void addToFolder(LLFolderViewFolder* folder);
void addToSession(const LLUUID& session_id);

View File

@ -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<LLUIImage> icon;
if (mIsMuted)
if (getIsMuted())
{
icon = mImageMute;
}

View File

@ -72,7 +72,10 @@ public:
void setPower(F32 val);
F32 getPower(F32 val) const { return mPower; }
bool getIsMuted() const { return (mIsMuted || mIsModeratorMuted); }
void setIsModeratorMuted(bool val) { mIsModeratorMuted = val; }
// For the current user, need to know the PTT state to show
// correct button image.
void setIsAgentControl(bool val) { mIsAgentControl = val; }
@ -131,6 +134,7 @@ private:
F32 mPower;
bool mIsAgentControl;
bool mIsModeratorMuted;
bool mIsMuted;
bool mIsTalking;
bool mShowParticipantsSpeaking;