diff mod_sms_clickatell/mod_sms_clickatell.lua @ 1321:3fd6579d60cc

mod_sms_clickatell: Get rid of legacy componentmanager usage. Now uses stanza events.
author Waqas Hussain <waqas20@gmail.com>
date Wed, 26 Feb 2014 12:38:57 -0500
parents ac9bf3fcbcfe
children 7dbde05b48a9
line wrap: on
line diff
--- a/mod_sms_clickatell/mod_sms_clickatell.lua	Wed Feb 26 18:36:22 2014 +0100
+++ b/mod_sms_clickatell/mod_sms_clickatell.lua	Wed Feb 26 12:38:57 2014 -0500
@@ -35,7 +35,6 @@
 
 local jid_split = require "util.jid".split;
 local st = require "util.stanza";
-local componentmanager = require "core.componentmanager";
 local datamanager = require "util.datamanager";
 local timer = require "util.timer";
 local config_get = require "core.configmanager".get;
@@ -584,7 +583,12 @@
 
 -- Component registration hooks: these hook in with the Prosody component
 -- manager 
-module.unload = function()
-	componentmanager.deregister_component(component_host);
-end
-component = componentmanager.register_component(component_host, sms_event_handler);
+module:hook("iq/bare", sms_event_handler);
+module:hook("message/bare", sms_event_handler);
+module:hook("presence/bare", sms_event_handler);
+module:hook("iq/full", sms_event_handler);
+module:hook("message/full", sms_event_handler);
+module:hook("presence/full", sms_event_handler);
+module:hook("iq/host", sms_event_handler);
+module:hook("message/host", sms_event_handler);
+module:hook("presence/host", sms_event_handler);