aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/crypto
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-12-29 11:09:37 +0100
committerChristian Schneppe <christian@pix-art.de>2016-12-29 11:09:37 +0100
commit9ed435c75ce3440c2acf7caed5e3f345537b2990 (patch)
tree79479e261c1bafcf0537e056990d2f8c1cef053d /src/main/java/de/pixart/messenger/crypto
parent294528f6093c05a98c5092a5c71e2dfcf11b9944 (diff)
don't throw assertion error when building session with same device id from other contact
Diffstat (limited to 'src/main/java/de/pixart/messenger/crypto')
-rw-r--r--src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java b/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java
index bedc0970a..16a4919fc 100644
--- a/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java
+++ b/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java
@@ -361,6 +361,10 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
return axolotlStore.getLocalRegistrationId();
}
+ public AxolotlAddress getOwnAxolotlAddress() {
+ return new AxolotlAddress(account.getJid().toBareJid().toPreppedString(),getOwnDeviceId());
+ }
+
public Set<Integer> getOwnDeviceIds() {
return this.deviceIds.get(account.getJid().toBareJid());
}
@@ -450,6 +454,7 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
} else {
Element item = mXmppConnectionService.getIqParser().getItem(packet);
Set<Integer> deviceIds = mXmppConnectionService.getIqParser().deviceIds(item);
+ Log.d(Config.LOGTAG,account.getJid().toBareJid()+": retrieved own device list: "+deviceIds);
registerDevices(account.getJid().toBareJid(),deviceIds);
}
}
@@ -818,7 +823,7 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
private void buildSessionFromPEP(final AxolotlAddress address) {
Log.i(Config.LOGTAG, AxolotlService.getLogprefix(account) + "Building new session for " + address.toString());
- if (address.getDeviceId() == getOwnDeviceId()) {
+ if (address.equals(getOwnAxolotlAddress())) {
throw new AssertionError("We should NEVER build a session with ourselves. What happened here?!");
}