about summary refs log tree commit diff stats
path: root/src/xmpp/stanza.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmpp/stanza.c')
-rw-r--r--src/xmpp/stanza.c5
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);