Fix key publishing

Remove invalid check for result code, which prevented publishing if the
node was empty to begin with.

Fix pepBroken check
This commit is contained in:
Andreas Straub 2015-08-26 00:27:39 +02:00
parent 05d3015421
commit 0eeaccd974

View file

@ -366,7 +366,7 @@ public class AxolotlService {
} }
public void publishBundlesIfNeeded() { public void publishBundlesIfNeeded() {
if (!pepBroken) { if (pepBroken) {
Log.d(Config.LOGTAG, getLogprefix(account) + "publishBundlesIfNeeded called, but PEP is broken. Ignoring... "); Log.d(Config.LOGTAG, getLogprefix(account) + "publishBundlesIfNeeded called, but PEP is broken. Ignoring... ");
return; return;
} }
@ -374,7 +374,6 @@ public class AxolotlService {
mXmppConnectionService.sendIqPacket(account, packet, new OnIqPacketReceived() { mXmppConnectionService.sendIqPacket(account, packet, new OnIqPacketReceived() {
@Override @Override
public void onIqPacketReceived(Account account, IqPacket packet) { public void onIqPacketReceived(Account account, IqPacket packet) {
if (packet.getType() == IqPacket.TYPE.RESULT) {
PreKeyBundle bundle = mXmppConnectionService.getIqParser().bundle(packet); PreKeyBundle bundle = mXmppConnectionService.getIqParser().bundle(packet);
Map<Integer, ECPublicKey> keys = mXmppConnectionService.getIqParser().preKeyPublics(packet); Map<Integer, ECPublicKey> keys = mXmppConnectionService.getIqParser().preKeyPublics(packet);
boolean flush = false; boolean flush = false;
@ -458,9 +457,6 @@ public class AxolotlService {
Log.e(Config.LOGTAG, AxolotlService.getLogprefix(account) + "Failed to publish bundle " + getOwnDeviceId() + ", reason: " + e.getMessage()); Log.e(Config.LOGTAG, AxolotlService.getLogprefix(account) + "Failed to publish bundle " + getOwnDeviceId() + ", reason: " + e.getMessage());
return; return;
} }
} else {
Log.d(Config.LOGTAG, getLogprefix(account) + "Error received while publishing Bundle:" + packet.findChild("error"));
}
} }
}); });
} }