diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/command/cmd_funcs.c | 10 | ||||
-rw-r--r-- | src/xmpp/iq.c | 4 | ||||
-rw-r--r-- | src/xmpp/xmpp.h | 1 |
3 files changed, 13 insertions, 2 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 71c8816a..6409ec54 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -5863,6 +5863,16 @@ cmd_ping(ProfWin *window, const char *const command, gchar **args) return TRUE; } + if (args[0] == NULL && connection_supports(XMPP_FEATURE_PING) == FALSE) { + cons_show("Server does not support ping requests."); + return TRUE; + } + + if (args[0] != NULL && caps_jid_has_feature(args[0], XMPP_FEATURE_PING) == FALSE) { + cons_show("%s does not support ping requests.", args[0]); + return TRUE; + } + iq_send_ping(args[0]); if (args[0] == NULL) { diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c index 4a44e05f..7f6b8de0 100644 --- a/src/xmpp/iq.c +++ b/src/xmpp/iq.c @@ -967,13 +967,13 @@ _autoping_timed_send(xmpp_conn_t *const conn, void *const userdata) return 1; } - if (connection_jid_for_feature(STANZA_NS_PING) == NULL) { + 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; + return 1; } if (autoping_wait) { diff --git a/src/xmpp/xmpp.h b/src/xmpp/xmpp.h index 2befccd2..fa36cf19 100644 --- a/src/xmpp/xmpp.h +++ b/src/xmpp/xmpp.h @@ -55,6 +55,7 @@ #define JABBER_PRIORITY_MIN -128 #define JABBER_PRIORITY_MAX 127 +#define XMPP_FEATURE_PING "urn:xmpp:ping" #define XMPP_FEATURE_BLOCKING "urn:xmpp:blocking" #define XMPP_FEATURE_RECEIPTS "urn:xmpp:receipts" #define XMPP_FEATURE_LASTACTIVITY "jabber:iq:last" |