aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/muc.lib.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-03-12 14:35:34 +0000
committerMatthew Wild <mwild1@gmail.com>2020-03-12 14:35:34 +0000
commit2692479e43cc1fd47c1bbed3612afe8c459dde51 (patch)
treea5765a5689e70ee582b66fc20351cdec476ec9e7 /plugins/muc/muc.lib.lua
parent656fe85b7aeddd0650e627e16c1eccc275cb12f1 (diff)
downloadprosody-2692479e43cc1fd47c1bbed3612afe8c459dde51.tar.gz
prosody-2692479e43cc1fd47c1bbed3612afe8c459dde51.zip
MUC: Pass previous role to :publicise_occupant_status() when destroying a MUC
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r--plugins/muc/muc.lib.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 2a7952cf..42f41831 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -908,12 +908,13 @@ function room_mt:clear(x)
x = x or st.stanza("x", {xmlns='http://jabber.org/protocol/muc#user'});
local occupants_updated = {};
for nick, occupant in self:each_occupant() do -- luacheck: ignore 213
+ local prev_role = occupant.role;
occupant.role = nil;
self:save_occupant(occupant);
- occupants_updated[occupant] = true;
+ occupants_updated[occupant] = prev_role;
end
- for occupant in pairs(occupants_updated) do
- self:publicise_occupant_status(occupant, x);
+ for occupant, prev_role in pairs(occupants_updated) do
+ self:publicise_occupant_status(occupant, x, nil, nil, nil, prev_role);
module:fire_event("muc-occupant-left", {
room = self;
nick = occupant.nick;