From 2b8b54ce10bbdd0dd6fd12fef5dbb749dc895ec5 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Thu, 21 May 2020 00:41:04 +0200 Subject: [PATCH] tweak in-chat-sounds --- .../securesms/notifications/NotificationCenter.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/org/thoughtcrime/securesms/notifications/NotificationCenter.java b/src/org/thoughtcrime/securesms/notifications/NotificationCenter.java index c86ac91ca..2cc898c87 100644 --- a/src/org/thoughtcrime/securesms/notifications/NotificationCenter.java +++ b/src/org/thoughtcrime/securesms/notifications/NotificationCenter.java @@ -289,6 +289,13 @@ public class NotificationCenter { DcChat dcChat = dcContext.getChat(chatId); + if (chatId == visibleChatId) { + // in-chat sounds are not related to notifications, + // they can be enabled/disabled independently + InChatSounds.getInstance(dcContext.context).playIncomingSound(); + return; + } + if (!Prefs.isNotificationsEnabled(context) || Prefs.isChatMuted(context, chatId)) { return; } @@ -299,11 +306,6 @@ public class NotificationCenter { return; } - if (chatId == visibleChatId) { - InChatSounds.getInstance(dcContext.context).playIncomingSound(); - return; - } - NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context); // get notification text as a single line