mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-31 18:16:21 +00:00
Send room destroy iq on /room config cancel
This commit is contained in:
@@ -452,6 +452,33 @@ stanza_create_instant_room_request_iq(xmpp_ctx_t *ctx, const char * const room_j
|
||||
return iq;
|
||||
}
|
||||
|
||||
xmpp_stanza_t *
|
||||
stanza_create_instant_room_destroy_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("leave");
|
||||
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 *destroy = xmpp_stanza_new(ctx);
|
||||
xmpp_stanza_set_name(destroy, STANZA_NAME_DESTROY);
|
||||
|
||||
xmpp_stanza_add_child(query, destroy);
|
||||
xmpp_stanza_release(destroy);
|
||||
|
||||
xmpp_stanza_add_child(iq, query);
|
||||
xmpp_stanza_release(query);
|
||||
|
||||
return iq;
|
||||
}
|
||||
|
||||
xmpp_stanza_t *
|
||||
stanza_create_presence(xmpp_ctx_t * const ctx)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user