aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/muc.lib.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-12-20 14:45:22 +0100
committerKim Alvefur <zash@zash.se>2018-12-20 14:45:22 +0100
commitea4cfb447d632982f0c52428576fb93262cdfe9e (patch)
tree5bc623da7ae38b50135ffd7bec377f4997a6a98b /plugins/muc/muc.lib.lua
parent9f7026fd496b72ae05a6050d037dd573cbda6f7a (diff)
downloadprosody-ea4cfb447d632982f0c52428576fb93262cdfe9e.tar.gz
prosody-ea4cfb447d632982f0c52428576fb93262cdfe9e.zip
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.
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r--plugins/muc/muc.lib.lua2
1 files changed, 1 insertions, 1 deletions
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