From 782b8fb74488ef0b45bf8f63d76539d4b8df743a Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 13 Dec 2017 20:28:30 +0100 Subject: [PATCH] fixup for pep omemo notification dedup --- .../conversations/crypto/axolotl/AxolotlService.java | 10 ++++++---- .../conversations/services/XmppConnectionService.java | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java index f449b4294..753304158 100644 --- a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java +++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java @@ -391,11 +391,13 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded { public void registerDevices(final Jid jid, @NonNull final Set deviceIds) { final int hash = deviceIds.hashCode(); final boolean me = jid.toBareJid().equals(account.getJid().toBareJid()); - if (me && hash == this.lastDeviceListNotificationHash) { - Log.d(Config.LOGTAG,account.getJid().toBareJid()+": ignoring duplicate own device id list"); - return; + if (me) { + if (hash == this.lastDeviceListNotificationHash) { + Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": ignoring duplicate own device id list"); + return; + } + this.lastDeviceListNotificationHash = hash; } - this.lastDeviceListNotificationHash = hash; boolean needsPublishing = me && !deviceIds.contains(getOwnDeviceId()); if (me) { deviceIds.remove(getOwnDeviceId()); diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 66bb4136e..51367f190 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -1250,7 +1250,7 @@ public class XmppConnectionService extends Service { if (!message.needsUploading()) { String pgpBody = message.getEncryptedBody(); String decryptedBody = message.getBody(); - message.setBody(pgpBody); + message.setBody(pgpBody); //TODO might throw NPE message.setEncryption(Message.ENCRYPTION_PGP); if (message.edited()) { message.setBody(decryptedBody);