Changeset

7411:f385cd6127b2

MUC: Add event for when room is done being created
author Kim Alvefur <zash@zash.se>
date Thu, 28 Apr 2016 22:57:53 +0200
parents 7410:45f543c82893
children 7412:f9744effae04
files plugins/muc/mod_muc.lua plugins/muc/muc.lib.lua
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/mod_muc.lua	Thu Apr 28 22:57:02 2016 +0200
+++ b/plugins/muc/mod_muc.lua	Thu Apr 28 22:57:53 2016 +0200
@@ -210,7 +210,7 @@
 	end
 end);
 
-module:hook("muc-room-pre-create", function(event)
+module:hook("muc-room-created", function(event)
 	track_room(event.room);
 end, -1000);
 
--- a/plugins/muc/muc.lib.lua	Thu Apr 28 22:57:02 2016 +0200
+++ b/plugins/muc/muc.lib.lua	Thu Apr 28 22:57:53 2016 +0200
@@ -435,6 +435,12 @@
 		origin = origin;
 		jid = real_jid;
 	});
+	module:fire_event("muc-room-created", {
+		room = self;
+		creator = dest_occupant;
+		stanza = stanza;
+		origin = origin;
+	});
 	return true;
 end