From 235281229dc3626581aeb409ac4db1c04fb39f72 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 13 Sep 2018 14:46:24 +0100 Subject: MUC: If a user with an existing affiliation registers, preserve that affiliation (thanks jc) --- plugins/muc/register.lib.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/muc') diff --git a/plugins/muc/register.lib.lua b/plugins/muc/register.lib.lua index f9841e06..21cb3f2f 100644 --- a/plugins/muc/register.lib.lua +++ b/plugins/muc/register.lib.lua @@ -174,7 +174,7 @@ local function handle_register_iq(room, origin, stanza) -- 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; -- cgit v1.2.3