mod_announce, mod_motd, mod_pubsub, mod_register, mod_watchregistrations, mod_welcome...
authorKim Alvefur <zash@zash.se>
Thu, 26 Jul 2012 02:35:13 +0000 (04:35 +0200)
committerKim Alvefur <zash@zash.se>
Thu, 26 Jul 2012 02:35:13 +0000 (04:35 +0200)
plugins/mod_announce.lua
plugins/mod_motd.lua
plugins/mod_pubsub.lua
plugins/mod_register.lua
plugins/mod_watchregistrations.lua
plugins/mod_welcome.lua

index 99fbae50951f8d9a5468858b9cff06eaf3928980..0cfd284ce5492833ca1ddf7890b0640263dfbddc 100644 (file)
@@ -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
index 39b74de98ef4af57e95bb635aa0016a1fe427b68..ddde9c7850d25c013955dbb9a4b6f619b6850fca 100644 (file)
@@ -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);
index 2cbd7184db8d47bff2c41c73cc1e0d7f26ab2ae1..40b119ccb234bca979761a9bcd18ea01cc6e591c 100644 (file)
@@ -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
 
index 755b718e2469e8e97aef6ddd91ebb9391e2b2c60..6c690c3bcaa17d59b44e8920eada90467909827d 100644 (file)
@@ -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
index ef18d713ab353c3406857883020fd31195c157c4..abca90bdab36103d3fb3ab16c0d42a2e923b8a84 100644 (file)
@@ -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);
index 8f9cca2ab2ce4a4315413e5203ca0a7b19ea1378..e498f0b31f8c0f19973d396b8981d9b168d0258b 100644 (file)
@@ -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);