diff options
author | Paul Fariello <paul@fariello.eu> | 2018-06-20 19:30:44 +0320 |
---|---|---|
committer | Paul Fariello <paul@fariello.eu> | 2018-09-05 13:52:19 +0200 |
commit | 233e076be95baf13a23e9dbefac208d424a57e5d (patch) | |
tree | 95868696fe5f3e2bed7b5a605633dd46e3a7216a /src/xmpp/stanza.c | |
parent | b11d3a79df49970b4563bbd40c4db3f53c99dfeb (diff) | |
download | profani-tty-233e076be95baf13a23e9dbefac208d424a57e5d.tar.gz |
Add support for command config execution
Diffstat (limited to 'src/xmpp/stanza.c')
-rw-r--r-- | src/xmpp/stanza.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c index 537fbf96..68919710 100644 --- a/src/xmpp/stanza.c +++ b/src/xmpp/stanza.c @@ -2063,6 +2063,31 @@ stanza_create_command_exec_iq(xmpp_ctx_t *ctx, const char *const target, return iq; } +xmpp_stanza_t* +stanza_create_command_config_submit_iq(xmpp_ctx_t *ctx, const char *const room, + const char *const node, const char *const sessionid, DataForm *form) +{ + char *id = connection_create_stanza_id("commandconf_submit"); + xmpp_stanza_t *iq = xmpp_iq_new(ctx, STANZA_TYPE_SET, id); + free(id); + xmpp_stanza_set_to(iq, room); + + xmpp_stanza_t *command = xmpp_stanza_new(ctx); + xmpp_stanza_set_name(command, STANZA_NAME_COMMAND); + xmpp_stanza_set_ns(command, STANZA_NS_COMMAND); + xmpp_stanza_set_attribute(command, "node", node); + xmpp_stanza_set_attribute(command, "sessionid", sessionid); + + xmpp_stanza_t *x = form_create_submission(form); + xmpp_stanza_add_child(command, x); + xmpp_stanza_release(x); + + xmpp_stanza_add_child(iq, command); + xmpp_stanza_release(command); + + return iq; +} + static void _stanza_add_unique_id(xmpp_stanza_t *stanza, char *prefix) { |