aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2024-11-15 14:37:10 +0000
committerMatthew Wild <mwild1@gmail.com>2024-11-15 14:37:10 +0000
commitd89b7fa67254ba4c71c112af8a3c10590252e5a2 (patch)
tree68a041590f532233832800d38b2fc8df325bc6c9 /plugins/muc
parentc9cc6f4b6740cf55d2e23ccd3e1bb320391ed571 (diff)
parent48b271450d86bd0730045cf1c34ff72caab18e26 (diff)
downloadprosody-d89b7fa67254ba4c71c112af8a3c10590252e5a2.tar.gz
prosody-d89b7fa67254ba4c71c112af8a3c10590252e5a2.zip
Merge 0.12->trunk
Diffstat (limited to 'plugins/muc')
-rw-r--r--plugins/muc/muc.lib.lua10
1 files changed, 4 insertions, 6 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index b8f276cf..359afc87 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -304,10 +304,10 @@ function room_mt:publicise_occupant_status(occupant, x, nick, actor, reason, pre
-- General populace
for occupant_nick, n_occupant in self:each_occupant() do
if occupant_nick ~= occupant.nick then
- local pr = get_p(n_occupant);
if broadcast_roles[occupant.role or "none"] or force_unavailable then
- self:route_to_occupant(n_occupant, pr);
+ self:route_to_occupant(n_occupant, get_p(n_occupant));
elseif prev_role and broadcast_roles[prev_role] then
+ local pr = get_p(n_occupant);
pr.attr.type = 'unavailable';
self:route_to_occupant(n_occupant, pr);
end
@@ -339,16 +339,14 @@ function room_mt:send_occupant_list(to, filter)
local broadcast_bare_jids = {}; -- Track which bare JIDs we have sent presence for
for occupant_jid, occupant in self:each_occupant() do
broadcast_bare_jids[occupant.bare_jid] = true;
- if filter == nil or filter(occupant_jid, occupant) then
+ if (filter == nil or filter(occupant_jid, occupant)) and (to_bare == occupant.bare_jid or broadcast_roles[occupant.role or "none"]) then
local x = st.stanza("x", {xmlns='http://jabber.org/protocol/muc#user'});
self:build_item_list(occupant, x, is_anonymous and to_bare ~= occupant.bare_jid); -- can always see your own jids
local pres = st.clone(occupant:get_presence());
pres.attr.to = to;
pres:add_child(x);
module:fire_event("muc-build-occupant-presence", { room = self, occupant = occupant, stanza = pres });
- if to_bare == occupant.bare_jid or broadcast_roles[occupant.role or "none"] then
- self:route_stanza(pres);
- end
+ self:route_stanza(pres);
end
end
if broadcast_roles.none then