From 85a028c727564dd2426e2ada2eee1a0b14838a70 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 20 Dec 2018 14:45:22 +0100 Subject: MUC: Allow changing data attached to an only owner (fixes #1273) This previously prevented a single owner from setting their own nickname via admin query. The form method uses `true` as actor so it bypasses this check. --- plugins/muc/muc.lib.lua | 2 +- spec/scansion/muc_register.scs | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 96cd0ffa..ef2054b1 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -1254,7 +1254,7 @@ function room_mt:set_affiliation(actor, jid, affiliation, reason, data) else local actor_affiliation = self:get_affiliation(actor); if actor_affiliation == "owner" then - if jid_bare(actor) == jid then -- self change + if jid_bare(actor) == jid and is_downgrade then -- self change -- need at least one owner local is_last = true; for j in self:each_affiliation("owner") do diff --git a/spec/scansion/muc_register.scs b/spec/scansion/muc_register.scs index 98af33f1..e1eaf4e0 100644 --- a/spec/scansion/muc_register.scs +++ b/spec/scansion/muc_register.scs @@ -504,3 +504,25 @@ Rosaline receives: + +# Romeo sets their their own nickname via admin query (see #1273) +Romeo sends: + + + + + + +Romeo receives: + + + + + + + + + +Romeo receives: + + -- cgit v1.2.3