aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorAndreas Straub <andy@strb.org>2015-07-07 19:32:52 +0200
committerAndreas Straub <andy@strb.org>2015-07-07 19:32:52 +0200
commit9d780a382a83d2fd732ff1e26b6ce31e3484ce77 (patch)
treef4704ba725d575d04bb4c663df44993eba9ca1ec /src/main/java
parent7cdf2a99465b765027f69ac98302dfaca582d05b (diff)
Fix devicelist update handling
No longer store own device ID (so that we don't encrypt messages for ourselves), verify that own device ID is present in update list (otherwise republish), reflect update in UI.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java5
-rw-r--r--src/main/java/eu/siacs/conversations/parser/MessageParser.java1
2 files changed, 6 insertions, 0 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 faa0e5ad..2b0954c6 100644
--- a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
+++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
@@ -640,10 +640,15 @@ public class AxolotlService {
}
public void registerDevices(final Jid jid, @NonNull final Set<Integer> deviceIds) {
+ if(deviceIds.contains(getOwnDeviceId())) {
+ Log.d(Config.LOGTAG, "Skipping own Device ID:"+ jid + ":"+getOwnDeviceId());
+ deviceIds.remove(getOwnDeviceId());
+ }
for(Integer i:deviceIds) {
Log.d(Config.LOGTAG, "Adding Device ID:"+ jid + ":"+i);
}
this.deviceIds.put(jid, deviceIds);
+ publishOwnDeviceIdIfNeeded();
}
public void publishOwnDeviceIdIfNeeded() {
diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
index f2f8238d..3c3b6dbe 100644
--- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java
+++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
@@ -194,6 +194,7 @@ public class MessageParser extends AbstractParser implements
Set<Integer> deviceIds = mXmppConnectionService.getIqParser().deviceIds(item);
AxolotlService axolotlService = account.getAxolotlService();
axolotlService.registerDevices(from, deviceIds);
+ mXmppConnectionService.updateAccountUi();
}
}