From: Matthew Wild Date: Tue, 27 Sep 2011 18:05:14 +0000 (+0100) Subject: mod_motd: Send no message (instead of 'blank') if no message is set in the config... X-Git-Url: https://git.enpas.org/?a=commitdiff_plain;h=4c8f78463bd2de271dcf038f75cfd07a813174c3;p=prosody.git mod_motd: Send no message (instead of 'blank') if no message is set in the config (thanks medics) --- diff --git a/plugins/mod_motd.lua b/plugins/mod_motd.lua index 462670e6..7c532a6b 100644 --- a/plugins/mod_motd.lua +++ b/plugins/mod_motd.lua @@ -8,9 +8,11 @@ -- local host = module:get_host(); -local motd_text = module:get_option("motd_text") or "MOTD: (blank)"; +local motd_text = module:get_option("motd_text"); local motd_jid = module:get_option("motd_jid") or host; +if not motd_text then return; end + local st = require "util.stanza"; motd_text = motd_text:gsub("^%s*(.-)%s*$", "%1"):gsub("\n%s+", "\n"); -- Strip indentation from the config