Software /
code /
prosody
Comparison
plugins/muc/mod_muc.lua @ 9007:695904638cfa
MUC: Flag rooms being destroyed (fixes #887)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 10 Jul 2018 21:10:12 +0200 |
parent | 8977:f4030a506d6b |
child | 9010:3c5ddd53fe50 |
comparison
equal
deleted
inserted
replaced
9006:935e5ca43792 | 9007:695904638cfa |
---|---|
154 end); | 154 end); |
155 | 155 |
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 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 |
160 module:fire_event("muc-room-destroyed", { room = room }); | 161 module:fire_event("muc-room-destroyed", { room = room }); |
161 end | 162 end |
162 end, -1); | 163 end, -1); |
163 | 164 |