From 1ac439b54d09ae908684d81bf0e448b42c17c11f Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Thu, 22 Feb 2018 21:18:32 +0100 Subject: request disco items before disco#info on first connect should make initial connect faster because code is not waiting for omemo code to run --- src/main/java/de/pixart/messenger/xmpp/XmppConnection.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/main/java/de/pixart') diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java index 418ea1982..a64175cb3 100644 --- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java +++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java @@ -1233,6 +1233,10 @@ public class XmppConnection implements Runnable { if (hash != null && ver != null) { discoveryResult = mXmppConnectionService.getCachedServiceDiscoveryResult(new Pair<>(hash, ver)); } + final boolean requestDiscoItemsFirst = !account.isOptionSet(Account.OPTION_LOGGED_IN_SUCCESSFULLY); + if (requestDiscoItemsFirst) { + sendServiceDiscoveryItems(account.getServer()); + } if (discoveryResult == null) { sendServiceDiscoveryInfo(account.getServer()); } else { @@ -1240,7 +1244,9 @@ public class XmppConnection implements Runnable { disco.put(account.getServer(), discoveryResult); } sendServiceDiscoveryInfo(account.getJid().toBareJid()); - sendServiceDiscoveryItems(account.getServer()); + if (!requestDiscoItemsFirst) { + sendServiceDiscoveryItems(account.getServer()); + } if (!mWaitForDisco.get()) { finalizeBind(); -- cgit v1.2.3