diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-08-01 10:50:57 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-08-01 10:50:57 +0200 |
commit | b7633e713fa79a8ab53c150726451d082fc3afd0 (patch) | |
tree | 02585d0cdb4600d0534bd0be41836b28725b2870 /src/main/java/de/pixart | |
parent | 9946cd074f0c34d9b820bffa840e9f6726039d35 (diff) |
catch state changing error when sending timeout to iq callbacks
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r-- | src/main/java/de/pixart/messenger/xmpp/XmppConnection.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java index fc40b410e..354065c0e 100644 --- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java +++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java @@ -1114,7 +1114,12 @@ public class XmppConnection implements Runnable { } } for (OnIqPacketReceived callback : callbacks) { - callback.onIqPacketReceived(account, failurePacket); + try { + callback.onIqPacketReceived(account, failurePacket); + } catch (StateChangingError error) { + Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": caught StateChangingError(" + error.state.toString() + ") while clearing callbacks"); + //ignore + } } Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": done clearing iq callbacks. " + this.packetCallbacks.size() + " left"); } @@ -1350,8 +1355,7 @@ public class XmppConnection implements Runnable { public synchronized String sendUnmodifiedIqPacket(final IqPacket packet, final OnIqPacketReceived callback) { if (packet.getId() == null) { - final String id = nextRandomId(); - packet.setAttribute("id", id); + packet.setAttribute("id", nextRandomId()); } if (callback != null) { synchronized (this.packetCallbacks) { |