Mercurial > prosody-modules
comparison 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 |
comparison
equal
deleted
inserted
replaced
1319:400a7fdd2049 | 1321:3fd6579d60cc |
---|---|
33 error(module.name.." should be loaded as a component, check out http://prosody.im/doc/components", 0); | 33 error(module.name.." should be loaded as a component, check out http://prosody.im/doc/components", 0); |
34 end | 34 end |
35 | 35 |
36 local jid_split = require "util.jid".split; | 36 local jid_split = require "util.jid".split; |
37 local st = require "util.stanza"; | 37 local st = require "util.stanza"; |
38 local componentmanager = require "core.componentmanager"; | |
39 local datamanager = require "util.datamanager"; | 38 local datamanager = require "util.datamanager"; |
40 local timer = require "util.timer"; | 39 local timer = require "util.timer"; |
41 local config_get = require "core.configmanager".get; | 40 local config_get = require "core.configmanager".get; |
42 local http = require "net.http"; | 41 local http = require "net.http"; |
43 local base64 = require "util.encodings".base64; | 42 local base64 = require "util.encodings".base64; |
582 end); | 581 end); |
583 --]] | 582 --]] |
584 | 583 |
585 -- Component registration hooks: these hook in with the Prosody component | 584 -- Component registration hooks: these hook in with the Prosody component |
586 -- manager | 585 -- manager |
587 module.unload = function() | 586 module:hook("iq/bare", sms_event_handler); |
588 componentmanager.deregister_component(component_host); | 587 module:hook("message/bare", sms_event_handler); |
589 end | 588 module:hook("presence/bare", sms_event_handler); |
590 component = componentmanager.register_component(component_host, sms_event_handler); | 589 module:hook("iq/full", sms_event_handler); |
590 module:hook("message/full", sms_event_handler); | |
591 module:hook("presence/full", sms_event_handler); | |
592 module:hook("iq/host", sms_event_handler); | |
593 module:hook("message/host", sms_event_handler); | |
594 module:hook("presence/host", sms_event_handler); |