summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authormberezhnoy <mberezhnoy@productengine.com>2013-03-01 12:58:18 +0200
committermberezhnoy <mberezhnoy@productengine.com>2013-03-01 12:58:18 +0200
commite33efdbc720ffb127a1efae790dcbcb58790ceb9 (patch)
tree02db0b0e6be0fa1462c49db9dd3cc5f47568fb66 /indra
parent2439956242670cfc52e6d27f0b37bb3b6f0ab6e0 (diff)
parent31e5465158db171a4ac6d3aa48d44e8a62c012f9 (diff)
merging
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llconversationmodel.cpp29
-rwxr-xr-xindra/newview/llconversationmodel.h6
-rwxr-xr-xindra/newview/llconversationview.cpp13
-rwxr-xr-xindra/newview/llconversationview.h1
-rw-r--r--indra/newview/lloutputmonitorctrl.cpp6
-rw-r--r--indra/newview/lloutputmonitorctrl.h3
6 files changed, 31 insertions, 27 deletions
diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp
index 0977056b2a..009fce0a92 100644
--- a/indra/newview/llconversationmodel.cpp
+++ b/indra/newview/llconversationmodel.cpp
@@ -322,7 +322,7 @@ void LLConversationItemSession::setParticipantIsMuted(const LLUUID& participant_
LLConversationItemParticipant* participant = findParticipant(participant_id);
if (participant)
{
- participant->setIsMuted(is_muted);
+ participant->muteVoice(is_muted);
}
}
@@ -462,7 +462,6 @@ 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),
- mIsMuted(false),
mIsModerator(false),
mDisplayModeratorLabel(false),
mDistToAgent(-1.0)
@@ -473,7 +472,6 @@ LLConversationItemParticipant::LLConversationItemParticipant(std::string display
LLConversationItemParticipant::LLConversationItemParticipant(const LLUUID& uuid, LLFolderViewModelInterface& root_view_model) :
LLConversationItem(uuid,root_view_model),
- mIsMuted(false),
mIsModerator(false),
mDisplayModeratorLabel(false),
mDistToAgent(-1.0)
@@ -549,7 +547,7 @@ LLConversationItemSession* LLConversationItemParticipant::getParentSession()
void LLConversationItemParticipant::dumpDebugData()
{
- llinfos << "Merov debug : participant, uuid = " << mUUID << ", name = " << mName << ", display name = " << mDisplayName << ", muted = " << mIsMuted << ", moderator = " << mIsModerator << llendl;
+ llinfos << "Merov debug : participant, uuid = " << mUUID << ", name = " << mName << ", display name = " << mDisplayName << ", muted = " << isVoiceMuted() << ", moderator = " << mIsModerator << llendl;
}
void LLConversationItemParticipant::setDisplayModeratorRole(bool displayRole)
@@ -561,6 +559,29 @@ void LLConversationItemParticipant::setDisplayModeratorRole(bool displayRole)
}
}
+bool LLConversationItemParticipant::isVoiceMuted()
+{
+ return LLMuteList::getInstance()->isMuted(mUUID, LLMute::flagVoiceChat);
+}
+
+void LLConversationItemParticipant::muteVoice(bool mute_voice)
+{
+ std::string name;
+ gCacheName->getFullName(mUUID, name);
+ LLMuteList * mute_listp = LLMuteList::getInstance();
+ bool voice_already_muted = mute_listp->isMuted(mUUID, name);
+
+ LLMute mute(mUUID, name, LLMute::AGENT);
+ if (voice_already_muted && !mute_voice)
+ {
+ mute_listp->remove(mute);
+ }
+ else if (!voice_already_muted && mute_voice)
+ {
+ mute_listp->add(mute);
+ }
+}
+
//
// LLConversationSort
//
diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h
index c907d1d6d2..8766585049 100755
--- a/indra/newview/llconversationmodel.h
+++ b/indra/newview/llconversationmodel.h
@@ -189,9 +189,9 @@ public:
virtual const std::string& getDisplayName() const { return mDisplayName; }
- bool isMuted() { return mIsMuted; }
- bool isModerator() {return mIsModerator; }
- void setIsMuted(bool is_muted) { mIsMuted = is_muted; mNeedsRefresh = true; }
+ bool isVoiceMuted();
+ bool isModerator() const { return mIsModerator; }
+ void muteVoice(bool 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; }
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index 73b2c6f88c..882ef64715 100755
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -527,19 +527,6 @@ S32 LLConversationViewParticipant::arrange(S32* width, S32* height)
return arranged;
}
-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->setIsMuted(participant_model->isMuted());
-
- // Do the regular upstream refresh
- LLFolderViewItem::refresh();
-}
-
void LLConversationViewParticipant::addToFolder(LLFolderViewFolder* folder)
{
// Add the item to the folder (conversation)
diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h
index f9b45073f4..76d3d079ea 100755
--- a/indra/newview/llconversationview.h
+++ b/indra/newview/llconversationview.h
@@ -130,7 +130,6 @@ 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);
diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp
index f6e3c0cac0..6c26073d5b 100644
--- a/indra/newview/lloutputmonitorctrl.cpp
+++ b/indra/newview/lloutputmonitorctrl.cpp
@@ -284,12 +284,12 @@ void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id, const LLUUID& s
{
if (speaker_id == gAgentID)
{
- setIsMuted(false);
+ mIsMuted = false;
}
else
{
// check only blocking on voice. EXT-3542
- setIsMuted(LLMuteList::getInstance()->isMuted(mSpeakerId, LLMute::flagVoiceChat));
+ mIsMuted = LLMuteList::getInstance()->isMuted(mSpeakerId, LLMute::flagVoiceChat);
LLMuteList::getInstance()->addObserver(this);
}
}
@@ -298,7 +298,7 @@ void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id, const LLUUID& s
void LLOutputMonitorCtrl::onChange()
{
// check only blocking on voice. EXT-3542
- setIsMuted(LLMuteList::getInstance()->isMuted(mSpeakerId, LLMute::flagVoiceChat));
+ mIsMuted = LLMuteList::getInstance()->isMuted(mSpeakerId, LLMute::flagVoiceChat);
}
// virtual
diff --git a/indra/newview/lloutputmonitorctrl.h b/indra/newview/lloutputmonitorctrl.h
index af2fd45823..a346909027 100644
--- a/indra/newview/lloutputmonitorctrl.h
+++ b/indra/newview/lloutputmonitorctrl.h
@@ -73,9 +73,6 @@ public:
void setPower(F32 val);
F32 getPower(F32 val) const { return mPower; }
- bool getIsMuted() const { return mIsMuted; }
- void setIsMuted(bool val) { mIsMuted = val; }
-
// For the current user, need to know the PTT state to show
// correct button image.
void setIsAgentControl(bool val) { mIsAgentControl = val; }