aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2013-04-29 11:25:12 +0100
committerMatthew Wild <mwild1@gmail.com>2013-04-29 11:25:12 +0100
commit0d3b110ee3a40b40fc4ffe129cde72811f83bbd9 (patch)
tree597ff844cc8161cd1787290e9eda8f1fe60eadbe /plugins
parent6fab120cf50b15b2afdf8befe1c39c4c955ab394 (diff)
downloadprosody-0d3b110ee3a40b40fc4ffe129cde72811f83bbd9.tar.gz
prosody-0d3b110ee3a40b40fc4ffe129cde72811f83bbd9.zip
MUC: Allow actor == true to set roles (like affiliations)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/muc/muc.lib.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index d3e6b1ee..a5aba3c8 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -1053,11 +1053,12 @@ function room_mt:get_role(nick)
return session and session.role or nil;
end
function room_mt:can_set_role(actor_jid, occupant_jid, role)
- local actor = self._occupants[self._jid_nick[actor_jid]];
local occupant = self._occupants[occupant_jid];
-
if not occupant or not actor then return nil, "modify", "not-acceptable"; end
+ if actor_jid == true then return true; end
+
+ local actor = self._occupants[self._jid_nick[actor_jid]];
if actor.role == "moderator" then
if occupant.affiliation ~= "owner" and occupant.affiliation ~= "admin" then
if actor.affiliation == "owner" or actor.affiliation == "admin" then