From 4330e1308d1858206a3da4fcfea39e04d1d5a141 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 26 Jul 2012 04:35:13 +0200 Subject: mod_announce, mod_motd, mod_pubsub, mod_register, mod_watchregistrations, mod_welcome: Use module:send() instead of core_*_stanza() --- plugins/mod_announce.lua | 2 +- plugins/mod_motd.lua | 2 +- plugins/mod_pubsub.lua | 2 +- plugins/mod_register.lua | 4 ++-- plugins/mod_watchregistrations.lua | 2 +- plugins/mod_welcome.lua | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) (limited to 'plugins') 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); -- cgit v1.2.3