Comparison

plugins/muc/mod_muc.lua @ 9010:3c5ddd53fe50

MUC: Log a debug message when a non-persistent room becomes empty and is destroyed
author Kim Alvefur <zash@zash.se>
date Wed, 11 Jul 2018 02:25:07 +0200
parent 9007:695904638cfa
child 9012:295faf1522f9
comparison
equal deleted inserted replaced
9009:4c745d42c974 9010:3c5ddd53fe50
156 -- Automatically destroy empty non-persistent rooms 156 -- Automatically destroy empty non-persistent rooms
157 module:hook("muc-occupant-left",function(event) 157 module:hook("muc-occupant-left",function(event)
158 local room = event.room 158 local room = event.room
159 if room.destroying then return end 159 if room.destroying then return end
160 if not room:has_occupant() and not persistent.get(room) then -- empty, non-persistent room 160 if not room:has_occupant() and not persistent.get(room) then -- empty, non-persistent room
161 module:log("debug", "%q empty, destroying", room.jid);
161 module:fire_event("muc-room-destroyed", { room = room }); 162 module:fire_event("muc-room-destroyed", { room = room });
162 end 163 end
163 end, -1); 164 end, -1);
164 165
165 function track_room(room) 166 function track_room(room)