MUC: Fix delay@from to be room JID (fixes #1416)
[prosody.git] / plugins / mod_welcome.lua
blobf6b13df558fb2e26d0e6609f83c9e50edca09eee
1 -- Prosody IM
2 -- Copyright (C) 2008-2010 Matthew Wild
3 -- Copyright (C) 2008-2010 Waqas Hussain
4 --
5 -- This project is MIT/X11 licensed. Please see the
6 -- COPYING file in the source package for more information.
7 --
9 local host = module:get_host();
10 local welcome_text = module:get_option_string("welcome_message", "Hello $username, welcome to the $host IM server!");
12 local st = require "util.stanza";
14 module:hook("user-registered",
15 function (user)
16 local welcome_stanza =
17 st.message({ to = user.username.."@"..user.host, from = host },
18 welcome_text:gsub("$(%w+)", user));
19 module:send(welcome_stanza);
20 module:log("debug", "Welcomed user %s@%s", user.username, user.host);
21 end);