From 5fcf18321540bfc596615951f8494bb59447c486 Mon Sep 17 00:00:00 2001 From: Angelo Fuchs Date: Sun, 4 Nov 2018 16:58:18 +0200 Subject: [PATCH] don't display notifications for the currently active thread. closes #32 notifications are now completle --- .../thoughtcrime/securesms/ApplicationContext.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/ApplicationContext.java b/src/org/thoughtcrime/securesms/ApplicationContext.java index ab943f345..570d8313b 100644 --- a/src/org/thoughtcrime/securesms/ApplicationContext.java +++ b/src/org/thoughtcrime/securesms/ApplicationContext.java @@ -156,7 +156,16 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc -> new AsyncTask() { @Override protected Void doInBackground(Long... params) { - MessageNotifier.updateNotification(dcContext.context); + if (data1 == null) + MessageNotifier.updateNotification(dcContext.context); + else { + if (data1 instanceof Long) + MessageNotifier.updateNotification(dcContext.context, ((Long)data1).intValue()); + else { + Log.w(TAG, "The type of chat was unclear. " + data1.getClass()); + MessageNotifier.updateNotification(dcContext.context); + } + } return null; } }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR), DcContext.DC_EVENT_INCOMING_MSG);