# HG changeset patch # User Matthew Wild # Date 1536846384 -3600 # Node ID 2d71040a959f3ae0a25e7f76a89a67da45e31a14 # Parent 8680a874f4838e1d37bb6ccbee34b7b1ed738d6d MUC: If a user with an existing affiliation registers, preserve that affiliation (thanks jc) diff -r 8680a874f483 -r 2d71040a959f plugins/muc/register.lib.lua --- a/plugins/muc/register.lib.lua Wed Sep 12 14:59:52 2018 +0100 +++ b/plugins/muc/register.lib.lua Thu Sep 13 14:46:24 2018 +0100 @@ -174,7 +174,7 @@ -- Checks passed, save the registration if registered_nick ~= desired_nick then local registration_data = { reserved_nickname = desired_nick }; - local ok, err_type, err_condition = room:set_affiliation(true, user_jid, "member", nil, registration_data); + local ok, err_type, err_condition = room:set_affiliation(true, user_jid, affiliation or "member", nil, registration_data); if not ok then origin.send(st.error_reply(stanza, err_type, err_condition)); return true; diff -r 8680a874f483 -r 2d71040a959f spec/scansion/muc_register.scs --- a/spec/scansion/muc_register.scs Wed Sep 12 14:59:52 2018 +0100 +++ b/spec/scansion/muc_register.scs Thu Sep 13 14:46:24 2018 +0100 @@ -286,3 +286,68 @@ Romeo receives: +# Romeo updates his own registration + +Romeo sends: + + + + +Romeo receives: + + + + + http://jabber.org/protocol/muc#register + + + + + + +Romeo sends: + + + + + http://jabber.org/protocol/muc#register + + + Romeo + + + + + +Romeo receives: + + + + + + + +Romeo receives: + + +Juliet receives: + + + + + + +# Romeo discovers his reserved nick + +Romeo sends: + + + + +Romeo receives: + + + + + +