Diff

plugins/muc/presence_broadcast.lib.lua @ 10685:98f21a155737

MUC: Don't unconditionally broadcast presence with role="none" Detailed explanation in de607875d4bd. A presence with role="none" (which is always type="unavailable") should only be broadcast if available presence was previously broadcast for that occupant.
author Matthew Wild <mwild1@gmail.com>
date Thu, 12 Mar 2020 14:13:22 +0000
parent 10516:d3e6941546a8
child 10687:8c2c5b4fde32
line wrap: on
line diff
--- a/plugins/muc/presence_broadcast.lib.lua	Thu Mar 12 14:10:12 2020 +0000
+++ b/plugins/muc/presence_broadcast.lib.lua	Thu Mar 12 14:13:22 2020 +0000
@@ -11,7 +11,6 @@
 
 local valid_roles = { "visitor", "participant", "moderator" };
 local default_broadcast = {
-	none = true;
 	visitor = true;
 	participant = true;
 	moderator = true;
@@ -24,9 +23,6 @@
 local function set_presence_broadcast(room, broadcast_roles)
 	broadcast_roles = broadcast_roles or default_broadcast;
 
-	-- Ensure that unavailable presence is always sent when role changes to none
-	broadcast_roles.none = true;
-
 	local changed = false;
 	local old_broadcast_roles = get_presence_broadcast(room);
 	for _, role in ipairs(valid_roles) do