mod_muc: Expose rooms table to the host and plugins

Mon, 20 Jul 2009 05:27:59 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Mon, 20 Jul 2009 05:27:59 +0100
changeset 1562
2b8674e87a24
parent 1561
04442f3ebe40
child 1566
9edeef1ad4f1

mod_muc: Expose rooms table to the host and plugins

plugins/mod_muc.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_muc.lua	Sat Jul 18 18:51:04 2009 +0100
+++ b/plugins/mod_muc.lua	Mon Jul 20 05:27:59 2009 +0100
@@ -76,6 +76,8 @@
 	handle_to_domain(origin, stanza);
 end);
 
+prosody.hosts[module:get_host()].muc = { rooms = rooms };
+
 module.unload = function()
 	deregister_component(muc_host);
 end
@@ -84,4 +86,5 @@
 end
 module.restore = function(data)
 	rooms = data.rooms or {};
+	prosody.hosts[module:get_host()].muc = { rooms = rooms };
 end

mercurial