aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/muc.lib.lua
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2014-09-05 11:20:54 -0400
committerdaurnimator <quae@daurnimator.com>2014-09-05 11:20:54 -0400
commit24eb372e33f37c917b008d90bf92a6ea8d020e34 (patch)
tree7fc1fabc920dedeef12a2d1488e3e409f9e15e96 /plugins/muc/muc.lib.lua
parentaa51ed52ec4359dd1c47f9025b78ab00c985cba9 (diff)
downloadprosody-24eb372e33f37c917b008d90bf92a6ea8d020e34.tar.gz
prosody-24eb372e33f37c917b008d90bf92a6ea8d020e34.zip
plugins/muc/muc.lib: Use get_affilation() inside of set_affiliation(), so that the override in mod_muc works
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r--plugins/muc/muc.lib.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index d430f984..31b5c559 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -984,10 +984,9 @@ function room_mt:set_affiliation(actor, jid, affiliation, reason)
local is_downgrade = valid_affiliations[target_affiliation or "none"] > valid_affiliations[affiliation or "none"];
if actor ~= true then
- local actor_bare = jid_bare(actor);
- local actor_affiliation = self._affiliations[actor_bare];
+ local actor_affiliation = self:get_affiliation(actor);
if actor_affiliation == "owner" then
- if actor_bare == jid then -- self change
+ if jid_bare(actor) == jid then -- self change
-- need at least one owner
local is_last = true;
for j, aff in pairs(self._affiliations) do if j ~= jid and aff == "owner" then is_last = false; break; end end