Add support to register with a room

`/affiliation register` can now be used to register a nickname with a
MUC.

Tested with a server without forms. Couldn't find a server which
supports forms yet.

Implements https://github.com/profanity-im/profanity/issues/1210
This commit is contained in:
Michael Vetter
2021-03-18 20:32:12 +01:00
parent 064174efa3
commit fde0a0d1c6
8 changed files with 164 additions and 6 deletions

View File

@@ -2828,3 +2828,18 @@ stanza_create_approve_voice(xmpp_ctx_t* ctx, const char* const id, const char* c
return message;
}
xmpp_stanza_t*
stanza_create_muc_register_nick(xmpp_ctx_t* ctx, const char* const id, const char* const jid, const char* const node, DataForm* form)
{
xmpp_stanza_t* iq = xmpp_iq_new(ctx, STANZA_TYPE_SET, id);
xmpp_stanza_set_to(iq, jid);
xmpp_stanza_t* x = form_create_submission(form);
xmpp_stanza_add_child(iq, x);
xmpp_stanza_release(x);
return iq;
}