Software /
code /
prosody
Comparison
plugins/mod_register.lua @ 5014:b2006c1cfa85
mod_announce, mod_motd, mod_pubsub, mod_register, mod_watchregistrations, mod_welcome: Use module:send() instead of core_*_stanza()
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 26 Jul 2012 04:35:13 +0200 |
parent | 4398:acc37e221940 |
child | 5096:50a64fd79c07 |
comparison
equal
deleted
inserted
replaced
5013:ab693eea0869 | 5014:b2006c1cfa85 |
---|---|
118 datamanager.list_store(username, host, "offline", nil); | 118 datamanager.list_store(username, host, "offline", nil); |
119 local bare = username.."@"..host; | 119 local bare = username.."@"..host; |
120 for jid, item in pairs(roster) do | 120 for jid, item in pairs(roster) do |
121 if jid and jid ~= "pending" then | 121 if jid and jid ~= "pending" then |
122 if item.subscription == "both" or item.subscription == "from" or (roster.pending and roster.pending[jid]) then | 122 if item.subscription == "both" or item.subscription == "from" or (roster.pending and roster.pending[jid]) then |
123 core_post_stanza(hosts[host], st.presence({type="unsubscribed", from=bare, to=jid})); | 123 module:send(st.presence({type="unsubscribed", from=bare, to=jid})); |
124 end | 124 end |
125 if item.subscription == "both" or item.subscription == "to" or item.ask then | 125 if item.subscription == "both" or item.subscription == "to" or item.ask then |
126 core_post_stanza(hosts[host], st.presence({type="unsubscribe", from=bare, to=jid})); | 126 module:send(st.presence({type="unsubscribe", from=bare, to=jid})); |
127 end | 127 end |
128 end | 128 end |
129 end | 129 end |
130 datamanager.store(username, host, "roster", nil); | 130 datamanager.store(username, host, "roster", nil); |
131 datamanager.store(username, host, "privacy", nil); | 131 datamanager.store(username, host, "privacy", nil); |