1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-10 18:15:58 +01:00

Use Async.go() in OmemoManager's connection listener

to prevent a timeout exception since those are executed synchronously.
This commit is contained in:
Florian Schmaus 2017-07-19 14:00:15 +02:00
parent 57e19d1a4f
commit 2e61e0a4d3

View file

@ -41,6 +41,7 @@ import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.packet.ExtensionElement; import org.jivesoftware.smack.packet.ExtensionElement;
import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.util.Async;
import org.jivesoftware.smackx.carbons.CarbonManager; import org.jivesoftware.smackx.carbons.CarbonManager;
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager; import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
@ -654,12 +655,18 @@ public final class OmemoManager extends Manager {
if (resumed) { if (resumed) {
return; return;
} }
try { Async.go(new Runnable() {
initialize(); @Override
} catch (InterruptedException | CorruptedOmemoKeyException | PubSubException.NotALeafNodeException | SmackException.NotLoggedInException | SmackException.NoResponseException | SmackException.NotConnectedException | XMPPException.XMPPErrorException e) { public void run() {
LOGGER.log(Level.SEVERE, "connectionListener.authenticated() failed to initialize OmemoManager: " try {
+ e.getMessage()); initialize();
} } catch (InterruptedException | CorruptedOmemoKeyException | PubSubException.NotALeafNodeException | SmackException.NotLoggedInException | SmackException.NoResponseException | SmackException.NotConnectedException | XMPPException.XMPPErrorException e) {
LOGGER.log(Level.SEVERE, "connectionListener.authenticated() failed to initialize OmemoManager: "
+ e.getMessage());
}
}
});
} }
@Override @Override