aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-08-17 22:29:19 +0200
committerfiaxh <git@mx.ax.lt>2017-08-19 00:29:08 +0200
commit299f52df3af8bc7dafcd9a5a6e12d31042734357 (patch)
tree4c3caea2a36e50c2583b3692cc89794560945316 /xmpp-vala
parent781d241b93c1d7696cafa524f0c6e00d84579951 (diff)
downloaddino-299f52df3af8bc7dafcd9a5a6e12d31042734357.tar.gz
dino-299f52df3af8bc7dafcd9a5a6e12d31042734357.zip
xmpp-vala: Connection fallback without SRV records
Diffstat (limited to 'xmpp-vala')
-rw-r--r--xmpp-vala/src/core/xmpp_stream.vala8
1 files changed, 6 insertions, 2 deletions
diff --git a/xmpp-vala/src/core/xmpp_stream.vala b/xmpp-vala/src/core/xmpp_stream.vala
index a461b2cb..6bb66445 100644
--- a/xmpp-vala/src/core/xmpp_stream.vala
+++ b/xmpp-vala/src/core/xmpp_stream.vala
@@ -55,8 +55,12 @@ public class XmppStream {
best_provider = connection_provider;
}
}
- if (best_provider == null) throw new IOStreamError.CONNECT("no suitable connection provider");
- IOStream? stream = best_provider.connect(this);
+ IOStream? stream = null;
+ if (best_provider != null) {
+ stream = best_provider.connect(this);
+ } else {
+ stream = (new SocketClient()).connect(new NetworkService("xmpp-client", "tcp", this.remote_name));
+ }
if (stream == null) throw new IOStreamError.CONNECT("client.connect() returned null");
reset_stream((!)stream);
} catch (Error e) {