about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorDominik Heidler <dheidler@suse.de>2017-06-16 12:09:12 +0200
committerDominik Heidler <dheidler@suse.de>2017-06-16 12:11:44 +0200
commit29f84ea3d43382d94b11e7a98b049e4380c210b5 (patch)
tree0c64c465d0e75c9b39b8a8da0727c5ad2cb52df2 /src
parentcbaa419a3174ced94ec5071dcd01a2da68500fce (diff)
downloadprofani-tty-29f84ea3d43382d94b11e7a98b049e4380c210b5.tar.gz
Disable autoping if server doesn't support it
fixes #859
Diffstat (limited to 'src')
-rw-r--r--src/xmpp/iq.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c
index edbf3557..4a44e05f 100644
--- a/src/xmpp/iq.c
+++ b/src/xmpp/iq.c
@@ -967,6 +967,15 @@ _autoping_timed_send(xmpp_conn_t *const conn, void *const userdata)
         return 1;
     }
 
+    if (connection_jid_for_feature(STANZA_NS_PING) == NULL) {
+        log_warning("Server doesn't advertise %s feature, disabling autoping.", STANZA_NS_PING);
+        prefs_set_autoping(0);
+        cons_show_error("Server ping not supported, autoping disabled.");
+        xmpp_conn_t *conn = connection_get_conn();
+        xmpp_timed_handler_delete(conn, _autoping_timed_send);
+		return 1;
+    }
+
     if (autoping_wait) {
         log_debug("Autoping: Existing ping already in progress, aborting");
         return 1;