X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=plugins%2Fmod_welcome.lua;h=e498f0b31f8c0f19973d396b8981d9b168d0258b;hb=ce4397ade64e10f16214c25c235b368d7ed29533;hp=8f92010a013d7279bac927f178f4651ce0901820;hpb=b4cb1e8079c6d93fdb6997327f06b8461244175b;p=prosody.git diff --git a/plugins/mod_welcome.lua b/plugins/mod_welcome.lua index 8f92010a..e498f0b3 100644 --- a/plugins/mod_welcome.lua +++ b/plugins/mod_welcome.lua @@ -11,11 +11,11 @@ local welcome_text = module:get_option("welcome_message") or "Hello $username, w local st = require "util.stanza"; -module:hook("user-registered", +module:hook("user-registered", function (user) - local welcome_stanza = + 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);