# HG changeset patch # User Kim Alvefur # Date 1343270113 -7200 # Node ID b2006c1cfa855c62c175cf8ad4c113dc76d4ec34 # Parent ab693eea0869f58a74b7731c9ca56966d8ff13a8 mod_announce, mod_motd, mod_pubsub, mod_register, mod_watchregistrations, mod_welcome: Use module:send() instead of core_*_stanza() diff -r ab693eea0869 -r b2006c1cfa85 plugins/mod_announce.lua --- a/plugins/mod_announce.lua Thu Jul 26 04:33:17 2012 +0200 +++ b/plugins/mod_announce.lua Thu Jul 26 04:35:13 2012 +0200 @@ -25,7 +25,7 @@ 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 -r ab693eea0869 -r b2006c1cfa85 plugins/mod_motd.lua --- a/plugins/mod_motd.lua Thu Jul 26 04:33:17 2012 +0200 +++ b/plugins/mod_motd.lua Thu Jul 26 04:35:13 2012 +0200 @@ -24,7 +24,7 @@ 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 -r ab693eea0869 -r b2006c1cfa85 plugins/mod_pubsub.lua --- a/plugins/mod_pubsub.lua Thu Jul 26 04:33:17 2012 +0200 +++ b/plugins/mod_pubsub.lua Thu Jul 26 04:35:13 2012 +0200 @@ -201,7 +201,7 @@ 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 -r ab693eea0869 -r b2006c1cfa85 plugins/mod_register.lua --- a/plugins/mod_register.lua Thu Jul 26 04:33:17 2012 +0200 +++ b/plugins/mod_register.lua Thu Jul 26 04:35:13 2012 +0200 @@ -120,10 +120,10 @@ 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 -r ab693eea0869 -r b2006c1cfa85 plugins/mod_watchregistrations.lua --- a/plugins/mod_watchregistrations.lua Thu Jul 26 04:33:17 2012 +0200 +++ b/plugins/mod_watchregistrations.lua Thu Jul 26 04:35:13 2012 +0200 @@ -25,6 +25,6 @@ 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 -r ab693eea0869 -r b2006c1cfa85 plugins/mod_welcome.lua --- a/plugins/mod_welcome.lua Thu Jul 26 04:33:17 2012 +0200 +++ b/plugins/mod_welcome.lua Thu Jul 26 04:35:13 2012 +0200 @@ -16,6 +16,6 @@ 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);