MUC: Fire muc-room-destroyed event when the last participant leaves a non-persistent...
authorKim Alvefur <zash@zash.se>
Sat, 18 Jan 2014 19:14:05 +0000 (20:14 +0100)
committerKim Alvefur <zash@zash.se>
Sat, 18 Jan 2014 19:14:05 +0000 (20:14 +0100)
plugins/muc/mod_muc.lua

index edebf0704448067ccb0018e474bc0faa4481aba0..6e86ab730d0451c6369995edc1ecee78543f8619 100644 (file)
@@ -163,6 +163,7 @@ function stanza_handler(event)
        if room then
                room:handle_stanza(origin, stanza);
                if not next(room._occupants) and not persistent_rooms[room.jid] then -- empty, non-persistent room
+                       module:fire_event("muc-room-destroyed", { room = room });
                        rooms[bare] = nil; -- discard room
                end
        else