X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=plugins%2Fmod_welcome.lua;h=8f9cca2ab2ce4a4315413e5203ca0a7b19ea1378;hb=0652193326c7b05560541610b60715cce4f22297;hp=cc50cba37b23c27d3e0e7af5af50488032f222c9;hpb=bc94b7aa0a4d5e10282fdf0f069e9485aca7838b;p=prosody.git diff --git a/plugins/mod_welcome.lua b/plugins/mod_welcome.lua index cc50cba3..8f9cca2a 100644 --- a/plugins/mod_welcome.lua +++ b/plugins/mod_welcome.lua @@ -1,19 +1,19 @@ -- Prosody IM --- Copyright (C) 2008-2009 Matthew Wild --- Copyright (C) 2008-2009 Waqas Hussain +-- Copyright (C) 2008-2010 Matthew Wild +-- Copyright (C) 2008-2010 Waqas Hussain -- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. -- local host = module:get_host(); -local welcome_text = module:get_option("welcome_message") or "Hello $user, welcome to the $host IM server!"; +local welcome_text = module:get_option("welcome_message") or "Hello $username, welcome to the $host IM server!"; 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);