Changeset

779:ec0eadf4e9ff

Changed mod_muc to work with changed component manager
author Waqas Hussain <waqas20@gmail.com>
date Wed, 11 Feb 2009 18:07:20 +0500
parents 778:0d94b4903cc7
children 780:4417ab6ccc20
files plugins/mod_muc.lua
diffstat 1 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_muc.lua	Wed Feb 11 17:57:48 2009 +0500
+++ b/plugins/mod_muc.lua	Wed Feb 11 18:07:20 2009 +0500
@@ -266,7 +266,7 @@
 	end
 end
 
-function handle_stanza(origin, stanza)
+register_component(muc_domain, function(origin, stanza)
 	local to_node, to_host, to_resource = jid_split(stanza.attr.to);
 	if stanza.name == "presence" and stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" then
 		if type == "error" or type == "result" then return; end
@@ -282,11 +282,7 @@
 		if type == "error" or type == "result" then return; end
 		handle_to_domain(origin, stanza);
 	end
-end
-
-module.load_component = function()
-	return handle_stanza; -- Return the function that we want to handle incoming stanzas
-end
+end);
 
 module.unload = function()
 	deregister_component(muc_domain);