Software / code / prosody
Comparison
plugins/mod_welcome.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 | 3540:bc139431830b |
| child | 5776:bd0ff8ae98a8 |
| child | 8160:5566f82ffea4 |
comparison
equal
deleted
inserted
replaced
| 5013:ab693eea0869 | 5014:b2006c1cfa85 |
|---|---|
| 14 module:hook("user-registered", | 14 module:hook("user-registered", |
| 15 function (user) | 15 function (user) |
| 16 local welcome_stanza = | 16 local welcome_stanza = |
| 17 st.message({ to = user.username.."@"..user.host, from = host }) | 17 st.message({ to = user.username.."@"..user.host, from = host }) |
| 18 :tag("body"):text(welcome_text:gsub("$(%w+)", user)); | 18 :tag("body"):text(welcome_text:gsub("$(%w+)", user)); |
| 19 core_route_stanza(hosts[host], welcome_stanza); | 19 module:send(welcome_stanza); |
| 20 module:log("debug", "Welcomed user %s@%s", user.username, user.host); | 20 module:log("debug", "Welcomed user %s@%s", user.username, user.host); |
| 21 end); | 21 end); |