Stop in-chat notification sounds if notifications are disabled.
This commit is contained in:
parent
de6b9bc4ef
commit
e1d8870160
3 changed files with 8 additions and 5 deletions
|
@ -308,7 +308,8 @@ object NotificationFactory {
|
|||
}
|
||||
|
||||
private fun notifyInThread(context: Context, recipient: Recipient, lastAudibleNotification: Long) {
|
||||
if (!SignalStore.settings.isMessageNotificationsInChatSoundsEnabled ||
|
||||
if (!NotificationChannels.getInstance().areNotificationsEnabled() ||
|
||||
!SignalStore.settings.isMessageNotificationsInChatSoundsEnabled ||
|
||||
ServiceUtil.getAudioManager(context).ringerMode != AudioManager.RINGER_MODE_NORMAL ||
|
||||
(System.currentTimeMillis() - lastAudibleNotification) < DefaultMessageNotifier.MIN_AUDIBLE_PERIOD_MILLIS
|
||||
) {
|
||||
|
|
|
@ -14,11 +14,11 @@ import org.signal.ringrtc.CallManager;
|
|||
import org.thoughtcrime.securesms.database.CallTable;
|
||||
import org.thoughtcrime.securesms.database.RecipientTable;
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase;
|
||||
import org.thoughtcrime.securesms.dependencies.AppDependencies;
|
||||
import org.thoughtcrime.securesms.events.CallParticipant;
|
||||
import org.thoughtcrime.securesms.events.WebRtcViewModel;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.notifications.DoNotDisturbUtil;
|
||||
import org.thoughtcrime.securesms.notifications.NotificationChannels;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.ringrtc.CallState;
|
||||
|
@ -197,7 +197,8 @@ public class IncomingCallActionProcessor extends DeviceAwareActionProcessor {
|
|||
}
|
||||
}
|
||||
|
||||
if (shouldDisturbUserWithCall && SignalStore.settings().isCallNotificationsEnabled()) {
|
||||
boolean isCallNotificationsEnabled = SignalStore.settings().isCallNotificationsEnabled() && NotificationChannels.getInstance().areNotificationsEnabled();
|
||||
if (shouldDisturbUserWithCall && isCallNotificationsEnabled) {
|
||||
Uri ringtone = recipient.resolve().getCallRingtone();
|
||||
RecipientTable.VibrateState vibrateState = recipient.resolve().getCallVibrate();
|
||||
|
||||
|
|
|
@ -13,13 +13,13 @@ import org.thoughtcrime.securesms.components.webrtc.BroadcastVideoSink;
|
|||
import org.thoughtcrime.securesms.components.webrtc.EglBaseWrapper;
|
||||
import org.thoughtcrime.securesms.database.RecipientTable;
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase;
|
||||
import org.thoughtcrime.securesms.dependencies.AppDependencies;
|
||||
import org.thoughtcrime.securesms.events.CallParticipant;
|
||||
import org.thoughtcrime.securesms.events.CallParticipantId;
|
||||
import org.thoughtcrime.securesms.events.WebRtcViewModel;
|
||||
import org.thoughtcrime.securesms.groups.GroupId;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.notifications.DoNotDisturbUtil;
|
||||
import org.thoughtcrime.securesms.notifications.NotificationChannels;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.ringrtc.RemotePeer;
|
||||
import org.thoughtcrime.securesms.service.webrtc.state.WebRtcServiceState;
|
||||
|
@ -133,7 +133,8 @@ public final class IncomingGroupCallActionProcessor extends DeviceAwareActionPro
|
|||
}
|
||||
}
|
||||
|
||||
if (shouldDisturbUserWithCall && SignalStore.settings().isCallNotificationsEnabled()) {
|
||||
boolean isCallNotificationsEnabled = SignalStore.settings().isCallNotificationsEnabled() && NotificationChannels.getInstance().areNotificationsEnabled();
|
||||
if (shouldDisturbUserWithCall && isCallNotificationsEnabled) {
|
||||
Uri ringtone = recipient.resolve().getCallRingtone();
|
||||
RecipientTable.VibrateState vibrateState = recipient.resolve().getCallVibrate();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue