diff options
author | James Booth <boothj5@gmail.com> | 2014-09-04 01:08:10 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-09-04 01:08:10 +0100 |
commit | 4ba33cb13c172a7280f8b5443e10ce0e113a2c47 (patch) | |
tree | b3ff78c56e384f483471e404ac6f8496a26bc434 /src/xmpp/stanza.c | |
parent | b50b786dcc39cd0eabff6ea0880759291b9b9b0b (diff) | |
download | profani-tty-4ba33cb13c172a7280f8b5443e10ce0e113a2c47.tar.gz |
Added /ping command
Diffstat (limited to 'src/xmpp/stanza.c')
-rw-r--r-- | src/xmpp/stanza.c | 5 |
1 files changed, 4 insertions, 1 deletions
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); |