about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2017-06-17 21:49:19 +0100
committerJames Booth <boothj5@gmail.com>2017-06-17 21:49:19 +0100
commit4a6bf6872745e5afa9cdfdbe00f7346ce1724d48 (patch)
tree4fa454d7bf70192d5469a025aa11b370ae32872c
parentf189dbc687843603e33cc950af3c158becf21a60 (diff)
parent29f84ea3d43382d94b11e7a98b049e4380c210b5 (diff)
downloadprofani-tty-4a6bf6872745e5afa9cdfdbe00f7346ce1724d48.tar.gz
Merge remote-tracking branch 'asdil12/ping'
-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..7f6b8de0 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_supports(STANZA_NS_PING) == FALSE) {
+        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;