MUC: Add event for when room is done being created
authorKim Alvefur <zash@zash.se>
Thu, 28 Apr 2016 20:57:53 +0000 (22:57 +0200)
committerKim Alvefur <zash@zash.se>
Thu, 28 Apr 2016 20:57:53 +0000 (22:57 +0200)
plugins/muc/mod_muc.lua
plugins/muc/muc.lib.lua

index 657823383481f95abe63c31c45a746d331970ab2..c50567e911f0a7f57313805363815f38762440d8 100644 (file)
@@ -210,7 +210,7 @@ module:hook("host-disco-items", function(event)
        end
 end);
 
-module:hook("muc-room-pre-create", function(event)
+module:hook("muc-room-created", function(event)
        track_room(event.room);
 end, -1000);
 
index 8efa295e31cc241926933422eb1f05f810802f9f..337d2ae41f364a48f291f6cac4c54f47e5fddaf0 100644 (file)
@@ -435,6 +435,12 @@ function room_mt:handle_first_presence(origin, stanza)
                origin = origin;
                jid = real_jid;
        });
+       module:fire_event("muc-room-created", {
+               room = self;
+               creator = dest_occupant;
+               stanza = stanza;
+               origin = origin;
+       });
        return true;
 end