diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-05-19 10:47:27 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-05-19 10:47:27 +0200 |
commit | 9ce2cfa3d2e8aac80f8e73855a879baad78dad0d (patch) | |
tree | 4e5a6280daccb45e3be52b293b6fe34ce76322c1 /src/main/java/eu/siacs/conversations/parser/IqParser.java | |
parent | 8d595c1fc2a083046a91919d9db29915d3dfeca6 (diff) |
resetting fetch status error when mutual subscription is reestablished
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/parser/IqParser.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/IqParser.java b/src/main/java/eu/siacs/conversations/parser/IqParser.java index afbc04124..189df4a7b 100644 --- a/src/main/java/eu/siacs/conversations/parser/IqParser.java +++ b/src/main/java/eu/siacs/conversations/parser/IqParser.java @@ -54,6 +54,7 @@ public class IqParser extends AbstractParser implements OnIqPacketReceived { final String name = item.getAttribute("name"); final String subscription = item.getAttribute("subscription"); final Contact contact = account.getRoster().getContact(jid); + boolean bothPre = contact.getOption(Contact.Options.TO) && contact.getOption(Contact.Options.FROM); if (!contact.getOption(Contact.Options.DIRTY_PUSH)) { contact.setServerName(name); contact.parseGroupsFromElement(item); @@ -69,6 +70,14 @@ public class IqParser extends AbstractParser implements OnIqPacketReceived { contact.parseSubscriptionFromElement(item); } } + boolean both = contact.getOption(Contact.Options.TO) && contact.getOption(Contact.Options.FROM); + if ((both != bothPre) && both) { + Log.d(Config.LOGTAG,account.getJid().toBareJid()+": gained mutual presence subscription with "+contact.getJid()); + AxolotlService axolotlService = account.getAxolotlService(); + if (axolotlService != null) { + axolotlService.clearErrorsInFetchStatusMap(contact.getJid()); + } + } mXmppConnectionService.getAvatarService().clear(contact); } } @@ -268,7 +277,7 @@ public class IqParser extends AbstractParser implements OnIqPacketReceived { @Override public void onIqPacketReceived(final Account account, final IqPacket packet) { - if (Config.EXTENDED_IQ_LOGGING && (packet.getType() == IqPacket.TYPE.GET || packet.getType() == IqPacket.TYPE.SET)) { + if (Config.BACKGROUND_STANZA_LOGGING && (packet.getType() == IqPacket.TYPE.GET || packet.getType() == IqPacket.TYPE.SET)) { Element first = packet.getChildren().size() > 0 ? packet.getChildren().get(0) : null; Log.d(Config.LOGTAG,account.getJid().toBareJid()+": IQ request from "+packet.getFrom()+(first == null ? "" : " "+first)); } |