aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2019-01-25 22:30:11 +0100
committerChristian Schneppe <christian@pix-art.de>2019-01-25 22:30:11 +0100
commit7c45fad36aea764eb274824bca3bbc5def13fd4f (patch)
treee3c2b107e403e997c3864204028923d57f9e95b0 /src/main/java/de/pixart
parentd93d92dee3add2bf293a177fd5d8afdbd691f684 (diff)
synchronize around notification update from corrected messages
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/parser/MessageParser.java2
-rw-r--r--src/main/java/de/pixart/messenger/services/NotificationService.java8
2 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/parser/MessageParser.java b/src/main/java/de/pixart/messenger/parser/MessageParser.java
index d8461d940..1f383b72d 100644
--- a/src/main/java/de/pixart/messenger/parser/MessageParser.java
+++ b/src/main/java/de/pixart/messenger/parser/MessageParser.java
@@ -650,7 +650,6 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
}
extractChatState(mXmppConnectionService.find(account, counterpart.asBareJid()), isTypeGroupChat, packet);
mXmppConnectionService.updateMessage(replacedMessage, uuid);
- mXmppConnectionService.getNotificationService().updateNotification(false);
if (mXmppConnectionService.confirmMessages()
&& replacedMessage.getStatus() == Message.STATUS_RECEIVED
&& (replacedMessage.trusted() || replacedMessage.getType() == Message.TYPE_PRIVATE)
@@ -664,6 +663,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
conversation.getAccount().getPgpDecryptionService().decrypt(replacedMessage, false);
}
}
+ mXmppConnectionService.getNotificationService().updateNotification();
return;
} else {
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": received message correction but verification didn't check out");
diff --git a/src/main/java/de/pixart/messenger/services/NotificationService.java b/src/main/java/de/pixart/messenger/services/NotificationService.java
index 9d0eeea2b..8ded39d50 100644
--- a/src/main/java/de/pixart/messenger/services/NotificationService.java
+++ b/src/main/java/de/pixart/messenger/services/NotificationService.java
@@ -383,7 +383,13 @@ public class NotificationService {
mBuilder.setColor(ContextCompat.getColor(mXmppConnectionService, R.color.primary));
}
- public void updateNotification(final boolean notify) {
+ public void updateNotification() {
+ synchronized (notifications) {
+ updateNotification(false);
+ }
+ }
+
+ private void updateNotification(final boolean notify) {
updateNotification(notify, null, false);
}