# HG changeset patch # User Kim Alvefur # Date 1531249812 -7200 # Node ID 695904638cfad3edd64a324a9b80a6044ed24cb7 # Parent 935e5ca437929a9729ae93a14728b4b5b76a0288 MUC: Flag rooms being destroyed (fixes #887) diff -r 935e5ca43792 -r 695904638cfa plugins/muc/mod_muc.lua --- a/plugins/muc/mod_muc.lua Tue Jul 10 00:52:46 2018 +0200 +++ b/plugins/muc/mod_muc.lua Tue Jul 10 21:10:12 2018 +0200 @@ -156,6 +156,7 @@ -- Automatically destroy empty non-persistent rooms module:hook("muc-occupant-left",function(event) local room = event.room + if room.destroying then return end if not room:has_occupant() and not persistent.get(room) then -- empty, non-persistent room module:fire_event("muc-room-destroyed", { room = room }); end diff -r 935e5ca43792 -r 695904638cfa plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Tue Jul 10 00:52:46 2018 +0200 +++ b/plugins/muc/muc.lib.lua Tue Jul 10 21:10:12 2018 +0200 @@ -848,6 +848,7 @@ if reason then x:tag("reason"):text(reason):up(); end if password then x:tag("password"):text(password):up(); end x:up(); + self.destroying = reason or true; self:clear(x); module:fire_event("muc-room-destroyed", { room = self }); return true;