projects
/
prosody.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
MUC: Assign priorities to config form hooks so they have a consistent order on each...
[prosody.git]
/
plugins
/
mod_welcome.lua
diff --git
a/plugins/mod_welcome.lua
b/plugins/mod_welcome.lua
index 05f5d3cfb8054893ea3c5d895c991aae9d4136e4..d74643de174ca4ff46fec5fe1ec51977f3148b28 100644
(file)
--- a/
plugins/mod_welcome.lua
+++ b/
plugins/mod_welcome.lua
@@
-1,23
+1,21
@@
--- Prosody IM
v0.4
--- Copyright (C) 2008-20
09
Matthew Wild
--- Copyright (C) 2008-20
09
Waqas Hussain
---
+-- Prosody IM
+-- 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.
--
-local config = require "core.configmanager";
-
local host = module:get_host();
local host = module:get_host();
-local welcome_text =
config.get("*", "core", "welcome_message") or "Hello $user, welcome to the $host IM server!"
;
+local welcome_text =
module:get_option_string("welcome_message", "Hello $username, welcome to the $host IM server!")
;
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);