From a11f6ea1e62d0fa3c82fd23b7b8cf0b681c141ca Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Thu, 11 Jun 2015 13:10:39 -0700 Subject: [PATCH] Don't signal on updates from muted threads. Fixes #3393 // FREEBIE --- .../securesms/notifications/MessageNotifier.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java b/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java index 2f0b08f882..c66ef99e55 100644 --- a/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java +++ b/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java @@ -124,10 +124,16 @@ public class MessageNotifier { } public static void updateNotification(Context context, MasterSecret masterSecret, long threadId) { - if (!TextSecurePreferences.isNotificationsEnabled(context)) { + Recipients recipients = DatabaseFactory.getThreadDatabase(context) + .getRecipientsForThreadId(threadId); + + if (!TextSecurePreferences.isNotificationsEnabled(context) || + (recipients != null && recipients.isMuted())) + { return; } + if (visibleThread == threadId) { ThreadDatabase threads = DatabaseFactory.getThreadDatabase(context); threads.setRead(threadId);