Add jid support for motd
authorJeff Mitchell <jeff@jefferai.org>
Sat, 29 May 2010 18:52:27 -0400
changeset 3170 bf83d75c961a
parent 3169 e37e83660114
child 3171 190827ba4591
Add jid support for motd
plugins/mod_motd.lua
--- a/plugins/mod_motd.lua	Sat May 29 14:02:58 2010 -0400
+++ b/plugins/mod_motd.lua	Sat May 29 18:52:27 2010 -0400
@@ -9,6 +9,7 @@
 
 local host = module:get_host();
 local motd_text = module:get_option("motd_text") or "MOTD: (blank)";
+local motd_jid = module:get_option("motd_jid") or host;
 
 local st = require "util.stanza";
 
@@ -16,7 +17,7 @@
 	function (event)
 		local session = event.session;
 		local motd_stanza =
-			st.message({ to = session.username..'@'..session.host, from = host })
+			st.message({ to = session.username..'@'..session.host, from = motd_jid })
 				:tag("body"):text(motd_text);
 		core_route_stanza(hosts[host], motd_stanza);
 		module:log("debug", "MOTD send to user %s@%s", session.username, session.host);