aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations
diff options
context:
space:
mode:
authorChristian S <christian@pix-art.de>2016-04-07 20:24:29 +0200
committerChristian S <christian@pix-art.de>2016-04-07 20:24:29 +0200
commit6291c64dd743e36539d06a0dbc242a25475989f9 (patch)
tree807c79fc6f1752edebd144531d54ac11f9100ba9 /src/main/java/eu/siacs/conversations
parent9317ea212cbf4f1bd739ed37c7702b52791c11a5 (diff)
parentecaf75e5ecf785dbe83a4d1ec5f9a76d22e688ad (diff)
Merge remote-tracking branch 'refs/remotes/siacs/master' into development
Diffstat (limited to 'src/main/java/eu/siacs/conversations')
-rw-r--r--src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java11
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java1
2 files changed, 10 insertions, 2 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 cc5c2491b..a24e45308 100644
--- a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
+++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
@@ -314,6 +314,11 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
return this.pepBroken;
}
+ public void resetBrokenness() {
+ this.pepBroken = false;
+ numPublishTriesOnEmptyPep = 0;
+ }
+
public void regenerateKeys(boolean wipeOther) {
axolotlStore.regenerate();
sessions.clear();
@@ -448,7 +453,8 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
mXmppConnectionService.sendIqPacket(account, publish, new OnIqPacketReceived() {
@Override
public void onIqPacketReceived(Account account, IqPacket packet) {
- if (packet.getType() != IqPacket.TYPE.RESULT) {
+ if (packet.getType() == IqPacket.TYPE.ERROR) {
+ pepBroken = true;
Log.d(Config.LOGTAG, getLogprefix(account) + "Error received while publishing own device id" + packet.findChild("error"));
}
}
@@ -612,7 +618,8 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
Log.d(Config.LOGTAG, getLogprefix(account) + "Announcing device " + getOwnDeviceId());
publishOwnDeviceIdIfNeeded();
}
- } else {
+ } else if (packet.getType() == IqPacket.TYPE.ERROR) {
+ pepBroken = true;
Log.d(Config.LOGTAG, getLogprefix(account) + "Error received while publishing bundle: " + packet.findChild("error"));
}
}
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index 669178324..878b4334f 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -2581,6 +2581,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
disconnect(account, force);
account.getRoster().clearPresences();
connection.resetEverything();
+ account.getAxolotlService().resetBrokenness();
}
}
}