diff options
author | Matthew Wild <mwild1@gmail.com> | 2011-09-27 19:05:14 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2011-09-27 19:05:14 +0100 |
commit | af932c423957c59d82affca3c2141f0d7eb36590 (patch) | |
tree | f6829bf77ab7c8da9dfba84de8caec2b791a5673 | |
parent | 1c3f397779097b8d99148ddafaabe55fb5fa551f (diff) | |
download | prosody-af932c423957c59d82affca3c2141f0d7eb36590.tar.gz prosody-af932c423957c59d82affca3c2141f0d7eb36590.zip |
mod_motd: Send no message (instead of 'blank') if no message is set in the config (thanks medics)
-rw-r--r-- | plugins/mod_motd.lua | 4 |
1 files changed, 3 insertions, 1 deletions
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 |