From 233e076be95baf13a23e9dbefac208d424a57e5d Mon Sep 17 00:00:00 2001 From: Paul Fariello Date: Wed, 20 Jun 2018 19:30:44 +0320 Subject: Add support for command config execution --- src/xmpp/stanza.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/xmpp/stanza.c') 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) { -- cgit 1.4.1-2-gfad0