From 4ba33cb13c172a7280f8b5443e10ce0e113a2c47 Mon Sep 17 00:00:00 2001 From: James Booth Date: Thu, 4 Sep 2014 01:08:10 +0100 Subject: Added /ping command --- src/xmpp/stanza.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/xmpp/stanza.c') diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c index 51e63ccc..09de1211 100644 --- a/src/xmpp/stanza.c +++ b/src/xmpp/stanza.c @@ -579,11 +579,14 @@ stanza_contains_chat_state(xmpp_stanza_t *stanza) } xmpp_stanza_t * -stanza_create_ping_iq(xmpp_ctx_t *ctx) +stanza_create_ping_iq(xmpp_ctx_t *ctx, const char * const target) { xmpp_stanza_t *iq = xmpp_stanza_new(ctx); xmpp_stanza_set_name(iq, STANZA_NAME_IQ); xmpp_stanza_set_type(iq, STANZA_TYPE_GET); + if (target != NULL) { + xmpp_stanza_set_attribute(iq, STANZA_ATTR_TO, target); + } char *id = create_unique_id("ping"); xmpp_stanza_set_id(iq, id); free(id); -- cgit 1.4.1-2-gfad0