From 8713a85beb9d45e6a8ad217a274459aad564309e Mon Sep 17 00:00:00 2001 From: agrajaghh Date: Tue, 13 May 2014 23:29:50 +0200 Subject: [PATCH] Add notification for key change event. Fixes #1460 --- .../thoughtcrime/securesms/service/PushReceiver.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/org/thoughtcrime/securesms/service/PushReceiver.java b/src/org/thoughtcrime/securesms/service/PushReceiver.java index 87eb9ee9d9..c38d1a949f 100644 --- a/src/org/thoughtcrime/securesms/service/PushReceiver.java +++ b/src/org/thoughtcrime/securesms/service/PushReceiver.java @@ -123,11 +123,13 @@ public class PushReceiver { IncomingPushMessage bundledMessage = message.withBody(preKeyExchange.getWhisperMessage().serialize()); handleReceivedSecureMessage(masterSecret, bundledMessage); } else { - String encoded = Base64.encodeBytes(message.getBody()); - IncomingTextMessage textMessage = new IncomingTextMessage(message, encoded, null); - IncomingPreKeyBundleMessage bundleMessage = new IncomingPreKeyBundleMessage(textMessage, encoded); + String encoded = Base64.encodeBytes(message.getBody()); + IncomingTextMessage textMessage = new IncomingTextMessage(message, encoded, null); + IncomingPreKeyBundleMessage bundleMessage = new IncomingPreKeyBundleMessage(textMessage, encoded); + EncryptingSmsDatabase database = DatabaseFactory.getEncryptingSmsDatabase(context); + Pair messageAndThreadId = database.insertMessageInbox(masterSecret, bundleMessage); - DatabaseFactory.getEncryptingSmsDatabase(context).insertMessageInbox(masterSecret, bundleMessage); + MessageNotifier.updateNotification(context, masterSecret, messageAndThreadId.second); } } catch (InvalidKeyException e) { Log.w("PushReceiver", e);