From 8e308d19855c488503bca65fd170ef1969dcf9fc Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 28 Apr 2016 22:57:53 +0200 Subject: MUC: Add event for when room is done being created --- plugins/muc/mod_muc.lua | 2 +- plugins/muc/muc.lib.lua | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua index 65782338..c50567e9 100644 --- a/plugins/muc/mod_muc.lua +++ b/plugins/muc/mod_muc.lua @@ -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); diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 8efa295e..337d2ae4 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -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 -- cgit v1.2.3