Skip to content

Commit e740bd2

Browse files
Toggle off 'Speak' button when muted by moderator
1 parent bee23b4 commit e740bd2

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

indra/newview/llfloaterimcontainer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2340,7 +2340,7 @@ LLSpeaker * LLFloaterIMContainer::getSpeakerOfSelectedParticipant(LLSpeakerMgr *
23402340
bool LLFloaterIMContainer::isNearbyChatSpeakerSelected()
23412341
{
23422342
LLFolderViewItem *selectedItem = mConversationsRoot->getCurSelectedItem();
2343-
if (NULL == selectedItem)
2343+
if (!selectedItem)
23442344
{
23452345
LL_WARNS() << "Current selected item is null" << LL_ENDL;
23462346
return NULL;

indra/newview/llnearbyvoicemoderation.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,24 +165,31 @@ void LLNearbyVoiceModeration::setMutedInfo(const std::string& channelID, bool mu
165165
it->second = mute;
166166
}
167167
}
168+
if (mute && LLVoiceClient::getInstance()->getUserPTTState())
169+
{
170+
LLVoiceClient::getInstance()->setUserPTTState(false);
171+
}
168172
}
169173

170-
void LLNearbyVoiceModeration::showNotificationIfNeeded()
174+
bool LLNearbyVoiceModeration::showNotificationIfNeeded()
171175
{
172176
if (LLVoiceClient::getInstance()->inProximalChannel() &&
173177
LLVoiceClient::getInstance()->getIsModeratorMuted(gAgentID))
174178
{
175-
showMutedNotification(true);
179+
return showMutedNotification(true);
176180
}
181+
return false;
177182
}
178183

179-
void LLNearbyVoiceModeration::showMutedNotification(bool is_muted)
184+
bool LLNearbyVoiceModeration::showMutedNotification(bool is_muted)
180185
{
181186
// Check if the current voice channel is nearby chat
182187
if (LLVoiceClient::getInstance()->inProximalChannel())
183188
{
184189
LLNotificationsUtil::add(is_muted ? "NearbyVoiceMutedByModerator" : "NearbyVoiceUnmutedByModerator");
190+
return true;
185191
}
192+
return false;
186193
}
187194

188195
bool LLNearbyVoiceModeration::isNearbyChatModerator()

indra/newview/llnearbyvoicemoderation.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class LLNearbyVoiceModeration : public LLSingleton <LLNearbyVoiceModeration> {
3636
void requestMuteAll(bool mute);
3737

3838
void setMutedInfo(const std::string& channelID, bool mute);
39-
void showMutedNotification(bool is_muted);
40-
void showNotificationIfNeeded();
39+
bool showMutedNotification(bool is_muted);
40+
bool showNotificationIfNeeded();
4141

4242
bool isNearbyChatModerator();
4343

indra/newview/llvoiceclient.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,11 @@ bool LLVoiceClient::getPTTIsToggle()
714714
void LLVoiceClient::inputUserControlState(bool down)
715715
{
716716
if (down && !getUserPTTState())
717-
LLNearbyVoiceModeration::getInstance()->showNotificationIfNeeded();
717+
{
718+
// Nearby chat is muted by moderator, don't toggle PTT
719+
if (LLNearbyVoiceModeration::getInstance()->showNotificationIfNeeded())
720+
return;
721+
}
718722

719723
if(mPTTIsToggle)
720724
{

0 commit comments

Comments
 (0)