Suppress mute message when already muted

Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
This commit is contained in:
Marcel Müller 2023-03-06 08:30:46 +01:00
Родитель 9d7d8a7a90
Коммит a1150668a0
1 изменённых файлов: 18 добавлений и 7 удалений

Просмотреть файл

@ -1075,15 +1075,26 @@ typedef void (^UpdateCallParticipantViewCellBlock)(CallParticipantViewCell *cell
- (void)forceMuteAudio
{
[self setAudioMuted:YES];
if (!_callController) {
return;
}
NSString *micDisabledString = NSLocalizedString(@"Microphone disabled", nil);
NSString *forceMutedString = NSLocalizedString(@"You have been muted by a moderator", nil);
[_callController getAudioEnabledStateWithCompletionBlock:^(BOOL isEnabled) {
if (!isEnabled) {
// We are already muted, no need to mute again
return;
}
dispatch_async(dispatch_get_main_queue(), ^{
[[JDStatusBarNotificationPresenter sharedPresenter] presentWithTitle:micDisabledString subtitle:forceMutedString includedStyle:JDStatusBarNotificationIncludedStyleDark completion:nil];
[[JDStatusBarNotificationPresenter sharedPresenter] dismissAfterDelay:7.0];
});
[self setAudioMuted:YES];
NSString *micDisabledString = NSLocalizedString(@"Microphone disabled", nil);
NSString *forceMutedString = NSLocalizedString(@"You have been muted by a moderator", nil);
dispatch_async(dispatch_get_main_queue(), ^{
[[JDStatusBarNotificationPresenter sharedPresenter] presentWithTitle:micDisabledString subtitle:forceMutedString includedStyle:JDStatusBarNotificationIncludedStyleDark completion:nil];
[[JDStatusBarNotificationPresenter sharedPresenter] dismissAfterDelay:7.0];
});
}];
}
- (void)setAudioMuted:(BOOL)isMuted