diff options
Diffstat (limited to 'src/xmpp/stanza.c')
-rw-r--r-- | src/xmpp/stanza.c | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c index e068eeed..b37d3fbd 100644 --- a/src/xmpp/stanza.c +++ b/src/xmpp/stanza.c @@ -430,7 +430,7 @@ stanza_create_instant_room_request_iq(xmpp_ctx_t *ctx, const char * const room_j xmpp_stanza_set_name(iq, STANZA_NAME_IQ); xmpp_stanza_set_type(iq, STANZA_TYPE_SET); xmpp_stanza_set_attribute(iq, STANZA_ATTR_TO, room_jid); - char *id = create_unique_id("leave"); + char *id = create_unique_id("room"); xmpp_stanza_set_id(iq, id); free(id); @@ -459,7 +459,7 @@ stanza_create_instant_room_destroy_iq(xmpp_ctx_t *ctx, const char * const room_j xmpp_stanza_set_name(iq, STANZA_NAME_IQ); xmpp_stanza_set_type(iq, STANZA_TYPE_SET); xmpp_stanza_set_attribute(iq, STANZA_ATTR_TO, room_jid); - char *id = create_unique_id("leave"); + char *id = create_unique_id("room"); xmpp_stanza_set_id(iq, id); free(id); @@ -480,6 +480,56 @@ stanza_create_instant_room_destroy_iq(xmpp_ctx_t *ctx, const char * const room_j } xmpp_stanza_t * +stanza_create_room_config_request_iq(xmpp_ctx_t *ctx, const char * const room_jid) +{ + xmpp_stanza_t *iq = xmpp_stanza_new(ctx); + xmpp_stanza_set_name(iq, STANZA_NAME_IQ); + xmpp_stanza_set_type(iq, STANZA_TYPE_GET); + xmpp_stanza_set_attribute(iq, STANZA_ATTR_TO, room_jid); + char *id = create_unique_id("room"); + xmpp_stanza_set_id(iq, id); + free(id); + + xmpp_stanza_t *query = xmpp_stanza_new(ctx); + xmpp_stanza_set_name(query, STANZA_NAME_QUERY); + xmpp_stanza_set_ns(query, STANZA_NS_MUC_OWNER); + + xmpp_stanza_add_child(iq, query); + xmpp_stanza_release(query); + + return iq; +} + +xmpp_stanza_t * +stanza_create_room_config_cancel_iq(xmpp_ctx_t *ctx, const char * const room_jid) +{ + xmpp_stanza_t *iq = xmpp_stanza_new(ctx); + xmpp_stanza_set_name(iq, STANZA_NAME_IQ); + xmpp_stanza_set_type(iq, STANZA_TYPE_SET); + xmpp_stanza_set_attribute(iq, STANZA_ATTR_TO, room_jid); + char *id = create_unique_id("room"); + xmpp_stanza_set_id(iq, id); + free(id); + + xmpp_stanza_t *query = xmpp_stanza_new(ctx); + xmpp_stanza_set_name(query, STANZA_NAME_QUERY); + xmpp_stanza_set_ns(query, STANZA_NS_MUC_OWNER); + + xmpp_stanza_t *x = xmpp_stanza_new(ctx); + xmpp_stanza_set_name(x, STANZA_NAME_X); + xmpp_stanza_set_type(x, "cancel"); + xmpp_stanza_set_ns(x, STANZA_NS_DATA); + + xmpp_stanza_add_child(query, x); + xmpp_stanza_release(x); + + xmpp_stanza_add_child(iq, query); + xmpp_stanza_release(query); + + return iq; +} + +xmpp_stanza_t * stanza_create_presence(xmpp_ctx_t * const ctx) { xmpp_stanza_t *presence = xmpp_stanza_new(ctx); |