summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2025-11-14 16:19:57 +0200
committerMnikolenko Productengine <mnikolenko@productengine.com>2025-11-14 16:19:57 +0200
commite740bd21e39e93666445abfeb32cf476c249cfb7 (patch)
tree1df16ba9894c812e025b321e540674aa5149ee11
parentbee23b4956b424f99765fb099906d3cb8250ce63 (diff)
Toggle off 'Speak' button when muted by moderator
-rw-r--r--indra/newview/llfloaterimcontainer.cpp2
-rw-r--r--indra/newview/llnearbyvoicemoderation.cpp13
-rw-r--r--indra/newview/llnearbyvoicemoderation.h4
-rw-r--r--indra/newview/llvoiceclient.cpp6
4 files changed, 18 insertions, 7 deletions
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index ac8234bf24..00b9c0b052 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -2340,7 +2340,7 @@ LLSpeaker * LLFloaterIMContainer::getSpeakerOfSelectedParticipant(LLSpeakerMgr *
bool LLFloaterIMContainer::isNearbyChatSpeakerSelected()
{
LLFolderViewItem *selectedItem = mConversationsRoot->getCurSelectedItem();
- if (NULL == selectedItem)
+ if (!selectedItem)
{
LL_WARNS() << "Current selected item is null" << LL_ENDL;
return NULL;
diff --git a/indra/newview/llnearbyvoicemoderation.cpp b/indra/newview/llnearbyvoicemoderation.cpp
index 5a6d7e1c6b..d3e540e838 100644
--- a/indra/newview/llnearbyvoicemoderation.cpp
+++ b/indra/newview/llnearbyvoicemoderation.cpp
@@ -165,24 +165,31 @@ void LLNearbyVoiceModeration::setMutedInfo(const std::string& channelID, bool mu
it->second = mute;
}
}
+ if (mute && LLVoiceClient::getInstance()->getUserPTTState())
+ {
+ LLVoiceClient::getInstance()->setUserPTTState(false);
+ }
}
-void LLNearbyVoiceModeration::showNotificationIfNeeded()
+bool LLNearbyVoiceModeration::showNotificationIfNeeded()
{
if (LLVoiceClient::getInstance()->inProximalChannel() &&
LLVoiceClient::getInstance()->getIsModeratorMuted(gAgentID))
{
- showMutedNotification(true);
+ return showMutedNotification(true);
}
+ return false;
}
-void LLNearbyVoiceModeration::showMutedNotification(bool is_muted)
+bool LLNearbyVoiceModeration::showMutedNotification(bool is_muted)
{
// Check if the current voice channel is nearby chat
if (LLVoiceClient::getInstance()->inProximalChannel())
{
LLNotificationsUtil::add(is_muted ? "NearbyVoiceMutedByModerator" : "NearbyVoiceUnmutedByModerator");
+ return true;
}
+ return false;
}
bool LLNearbyVoiceModeration::isNearbyChatModerator()
diff --git a/indra/newview/llnearbyvoicemoderation.h b/indra/newview/llnearbyvoicemoderation.h
index 95bae9ca2a..619f169883 100644
--- a/indra/newview/llnearbyvoicemoderation.h
+++ b/indra/newview/llnearbyvoicemoderation.h
@@ -36,8 +36,8 @@ class LLNearbyVoiceModeration : public LLSingleton <LLNearbyVoiceModeration> {
void requestMuteAll(bool mute);
void setMutedInfo(const std::string& channelID, bool mute);
- void showMutedNotification(bool is_muted);
- void showNotificationIfNeeded();
+ bool showMutedNotification(bool is_muted);
+ bool showNotificationIfNeeded();
bool isNearbyChatModerator();
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index 5a2ef248ba..2d732d0a71 100644
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -714,7 +714,11 @@ bool LLVoiceClient::getPTTIsToggle()
void LLVoiceClient::inputUserControlState(bool down)
{
if (down && !getUserPTTState())
- LLNearbyVoiceModeration::getInstance()->showNotificationIfNeeded();
+ {
+ // Nearby chat is muted by moderator, don't toggle PTT
+ if (LLNearbyVoiceModeration::getInstance()->showNotificationIfNeeded())
+ return;
+ }
if(mPTTIsToggle)
{