MUC: Add event for when room is done being created
[prosody.git] / plugins / muc / mod_muc.lua
index 14b716e14a204393190b0e79f97064ecedf35dc3..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);
 
@@ -273,6 +273,7 @@ for event_name, method in pairs {
                        -- Watch presence to create rooms
                        if stanza.attr.type == nil and stanza.name == "presence" then
                                room = muclib.new_room(room_jid);
+                               return room:handle_first_presence(origin, stanza);
                        elseif stanza.attr.type ~= "error" then
                                origin.send(st.error_reply(stanza, "cancel", "not-allowed"));
                                return true;