projects
/
prosody.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge Tobias SCRAM-PLUS work
[prosody.git]
/
plugins
/
mod_welcome.lua
diff --git
a/plugins/mod_welcome.lua
b/plugins/mod_welcome.lua
index edcfbd8c0f134306b45cef949bba672f4e0f7d56..9c0c821b582b6b771c37f6a1672c8b17aad5f681 100644
(file)
--- a/
plugins/mod_welcome.lua
+++ b/
plugins/mod_welcome.lua
@@
-1,7
+1,7
@@
-- Prosody IM
-- Prosody IM
--- Copyright (C) 2008-20
09
Matthew Wild
--- Copyright (C) 2008-20
09
Waqas Hussain
---
+-- Copyright (C) 2008-20
10
Matthew Wild
+-- Copyright (C) 2008-20
10
Waqas Hussain
+--
-- This project is MIT/X11 licensed. Please see the
-- COPYING file in the source package for more information.
--
-- This project is MIT/X11 licensed. Please see the
-- COPYING file in the source package for more information.
--
@@
-11,11
+11,11
@@
local welcome_text = module:get_option("welcome_message") or "Hello $username, w
local st = require "util.stanza";
local st = require "util.stanza";
-module:hook("user-registered",
+module:hook("user-registered",
function (user)
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));
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);
module:log("debug", "Welcomed user %s@%s", user.username, user.host);
end);