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);