Add support to approve MUC voice requests

A form will open. One can then use `/field4 on` `/form submit`.

Implements https://github.com/profanity-im/profanity/issues/1507
This commit is contained in:
Michael Vetter
2021-03-17 16:16:59 +01:00
parent 5d2037aa0c
commit 5cec47c86a
3 changed files with 52 additions and 2 deletions

View File

@@ -2813,3 +2813,18 @@ stanza_request_voice(xmpp_ctx_t* ctx, const char* const room)
return message;
}
xmpp_stanza_t*
stanza_create_approve_voice(xmpp_ctx_t* ctx, const char* const id, const char* const jid, const char* const node, DataForm* form)
{
char* stid = connection_create_stanza_id();
xmpp_stanza_t* message = xmpp_message_new(ctx, NULL, jid, stid);
free(stid);
xmpp_stanza_t* x = form_create_submission(form);
xmpp_stanza_add_child(message, x);
xmpp_stanza_release(x);
return message;
}