diff options
author | Kim Alvefur <zash@zash.se> | 2012-07-26 04:35:13 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2012-07-26 04:35:13 +0200 |
commit | df70fc25088c763d2878f796f9628415db79e8c6 (patch) | |
tree | b262fce04e2743e13aa28d39844d2bff7bf354dc | |
parent | 9114e88ee0cf86ca0ffe500e089389e54bb730ec (diff) | |
download | prosody-df70fc25088c763d2878f796f9628415db79e8c6.tar.gz prosody-df70fc25088c763d2878f796f9628415db79e8c6.zip |
mod_announce, mod_motd, mod_pubsub, mod_register, mod_watchregistrations, mod_welcome: Use module:send() instead of core_*_stanza()
-rw-r--r-- | plugins/mod_announce.lua | 2 | ||||
-rw-r--r-- | plugins/mod_motd.lua | 2 | ||||
-rw-r--r-- | plugins/mod_pubsub.lua | 2 | ||||
-rw-r--r-- | plugins/mod_register.lua | 4 | ||||
-rw-r--r-- | plugins/mod_watchregistrations.lua | 2 | ||||
-rw-r--r-- | plugins/mod_welcome.lua | 2 |
6 files changed, 7 insertions, 7 deletions
diff --git a/plugins/mod_announce.lua b/plugins/mod_announce.lua index 99fbae50..0cfd284c 100644 --- a/plugins/mod_announce.lua +++ b/plugins/mod_announce.lua @@ -25,7 +25,7 @@ function send_to_online(message, host) for username in pairs(host_session.sessions) do c = c + 1; message.attr.to = username.."@"..hostname; - core_post_stanza(host_session, message); + module:send(message); end end end diff --git a/plugins/mod_motd.lua b/plugins/mod_motd.lua index 39b74de9..ddde9c78 100644 --- a/plugins/mod_motd.lua +++ b/plugins/mod_motd.lua @@ -24,7 +24,7 @@ module:hook("presence/bare", function (event) local motd_stanza = st.message({ to = session.full_jid, from = motd_jid }) :tag("body"):text(motd_text); - core_route_stanza(hosts[host], motd_stanza); + module:send(motd_stanza); module:log("debug", "MOTD send to user %s", session.full_jid); end end, 1); diff --git a/plugins/mod_pubsub.lua b/plugins/mod_pubsub.lua index 2cbd7184..40b119cc 100644 --- a/plugins/mod_pubsub.lua +++ b/plugins/mod_pubsub.lua @@ -201,7 +201,7 @@ function simple_broadcast(node, jids, item) for jid in pairs(jids) do module:log("debug", "Sending notification to %s", jid); message.attr.to = jid; - core_post_stanza(hosts[module.host], message); + module:send(message); end end diff --git a/plugins/mod_register.lua b/plugins/mod_register.lua index 755b718e..6c690c3b 100644 --- a/plugins/mod_register.lua +++ b/plugins/mod_register.lua @@ -120,10 +120,10 @@ local function handle_registration_stanza(event) for jid, item in pairs(roster) do if jid and jid ~= "pending" then if item.subscription == "both" or item.subscription == "from" or (roster.pending and roster.pending[jid]) then - core_post_stanza(hosts[host], st.presence({type="unsubscribed", from=bare, to=jid})); + module:send(st.presence({type="unsubscribed", from=bare, to=jid})); end if item.subscription == "both" or item.subscription == "to" or item.ask then - core_post_stanza(hosts[host], st.presence({type="unsubscribe", from=bare, to=jid})); + module:send(st.presence({type="unsubscribe", from=bare, to=jid})); end end end diff --git a/plugins/mod_watchregistrations.lua b/plugins/mod_watchregistrations.lua index ef18d713..abca90bd 100644 --- a/plugins/mod_watchregistrations.lua +++ b/plugins/mod_watchregistrations.lua @@ -25,6 +25,6 @@ module:hook("user-registered", function (user) for jid in registration_watchers do module:log("debug", "Notifying %s", jid); message.attr.to = jid; - core_route_stanza(hosts[host], message); + module:send(message); end end); diff --git a/plugins/mod_welcome.lua b/plugins/mod_welcome.lua index 8f9cca2a..e498f0b3 100644 --- a/plugins/mod_welcome.lua +++ b/plugins/mod_welcome.lua @@ -16,6 +16,6 @@ module:hook("user-registered", local welcome_stanza = st.message({ to = user.username.."@"..user.host, from = host }) :tag("body"):text(welcome_text:gsub("$(%w+)", user)); - core_route_stanza(hosts[host], welcome_stanza); + module:send(welcome_stanza); module:log("debug", "Welcomed user %s@%s", user.username, user.host); end); |