diff options
author | daurnimator <quae@daurnimator.com> | 2014-10-15 14:28:16 -0400 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2014-10-15 14:28:16 -0400 |
commit | 28080879f2a11f61d2841471d98c0bbc1150548b (patch) | |
tree | c721ce6d3686b3e16baba8b713e1dfc17f39356a /plugins/muc/muc.lib.lua | |
parent | 161f220404b6519eda9288e9a38cd0c1eb76179e (diff) | |
download | prosody-28080879f2a11f61d2841471d98c0bbc1150548b.tar.gz prosody-28080879f2a11f61d2841471d98c0bbc1150548b.zip |
plugins/muc/muc.lib: Fix passing actor along as a boolean (thanks fippo)
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r-- | plugins/muc/muc.lib.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index eb6738aa..19614e82 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -1000,7 +1000,9 @@ function room_mt:set_affiliation(actor, jid, affiliation, reason) local target_affiliation = self._affiliations[jid]; -- Raw; don't want to check against host local is_downgrade = valid_affiliations[target_affiliation or "none"] > valid_affiliations[affiliation or "none"]; - if actor ~= true then + if actor == true then + actor = nil -- So we can pass it safely to 'publicise_occupant_status' below + else local actor_affiliation = self:get_affiliation(actor); if actor_affiliation == "owner" then if jid_bare(actor) == jid then -- self change @@ -1098,7 +1100,9 @@ function room_mt:set_role(actor, occupant_jid, role, reason) end role = role ~= "none" and role or nil; -- coerces `role == false` to `nil` - if actor ~= true then + if actor == true then + actor = nil -- So we can pass it safely to 'publicise_occupant_status' below + else -- Can't do anything to other owners or admins local occupant_affiliation = self:get_affiliation(occupant.bare_jid); if occupant_affiliation == "owner" and occupant_affiliation == "admin" then |