mod_muc: Fire muc-room-created and muc-room-destroyed events (thanks nik)
authorMatthew Wild <mwild1@gmail.com>
Tue, 14 May 2013 08:38:54 +0000 (09:38 +0100)
committerMatthew Wild <mwild1@gmail.com>
Tue, 14 May 2013 08:38:54 +0000 (09:38 +0100)
plugins/muc/mod_muc.lua
plugins/muc/muc.lib.lua

index 7861092c40598dfa7aabbbb2780d5c580732db08..0f1beb0e5f1f6801ce8de79299c2903764ac4009 100644 (file)
@@ -83,6 +83,7 @@ function create_room(jid)
        room.route_stanza = room_route_stanza;
        room.save = room_save;
        rooms[jid] = room;
+       module:fire_event("muc-room-created", { room = room });
        return room;
 end
 
index a5aba3c8d31986854e946282b5d940c3fe0292ac..1ea231f3de198543d3ce02ff77a75e54cdf098a9 100644 (file)
@@ -767,6 +767,7 @@ function room_mt:destroy(newjid, reason, password)
                self._occupants[nick] = nil;
        end
        self:set_persistent(false);
+       module:fire_event("muc-room-destroyed", { room = self });
 end
 
 function room_mt:handle_to_room(origin, stanza) -- presence changes and groupchat messages, along with disco/etc