mirror of
https://github.com/moparisthebest/Conversations
synced 2024-12-25 08:58:55 -05:00
better detect broken pep
mark pep as broken when publishing bundle or device list failed reset 'brokenness' when account is getting disabled
This commit is contained in:
parent
a968260b18
commit
ecaf75e5ec
@ -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"));
|
||||
}
|
||||
}
|
||||
|
@ -2581,6 +2581,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
|
||||
disconnect(account, force);
|
||||
account.getRoster().clearPresences();
|
||||
connection.resetEverything();
|
||||
account.getAxolotlService().resetBrokenness();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user