Software /
code /
prosody
Changeset
4389:886eebf10802
mod_motd: Send no message (instead of 'blank') if no message is set in the config (thanks medics)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 27 Sep 2011 19:05:14 +0100 |
parents | 4388:eded80beab58 |
children | 4390:5e84fb3c4ba0 |
files | plugins/mod_motd.lua |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_motd.lua Tue Sep 27 17:28:56 2011 +0100 +++ b/plugins/mod_motd.lua Tue Sep 27 19:05:14 2011 +0100 @@ -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