aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-12-15 13:36:08 +0000
committerMatthew Wild <mwild1@gmail.com>2020-12-15 13:36:08 +0000
commit2d7720dc0957c77ff5b44df1f176e024666e2e70 (patch)
tree5aa16fdfa1a18dfc7624992d1e0646a2df85da7e /plugins
parente34e79a6c056481cf75c084d081adfd8f5fe0c04 (diff)
downloadprosody-2d7720dc0957c77ff5b44df1f176e024666e2e70.tar.gz
prosody-2d7720dc0957c77ff5b44df1f176e024666e2e70.zip
MUC: Fix logic bug causing unnecessary presence to be sent, fixes #1615 (thanks damencho)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/muc/muc.lib.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 3139c131..037baa37 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -1326,8 +1326,8 @@ function room_mt:set_affiliation(actor, jid, affiliation, reason, data)
if occupant.role == nil then
module:fire_event("muc-occupant-left", {room = self; nick = occupant.nick; occupant = occupant;});
elseif is_semi_anonymous and
- (old_role == "moderator" and occupant.role ~= "moderator") or
- (old_role ~= "moderator" and occupant.role == "moderator") then -- Has gained or lost moderator status
+ ((old_role == "moderator" and occupant.role ~= "moderator") or
+ (old_role ~= "moderator" and occupant.role == "moderator")) then -- Has gained or lost moderator status
-- Send everyone else's presences (as jid visibility has changed)
for real_jid in occupant:each_session() do
self:send_occupant_list(real_jid, function(occupant_jid, occupant) --luacheck: ignore 212 433