diff options
author | Kim Alvefur <zash@zash.se> | 2019-01-17 01:05:47 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-01-17 01:05:47 +0100 |
commit | 8746fdc0c095c97e529f65c022e000da872bffa5 (patch) | |
tree | 14681f2ec8f240df717ac5b1c8d88f07e6517769 /plugins/mod_motd.lua | |
parent | af6f44e477b137f500904f2d932c7a3ac2ae9195 (diff) | |
download | prosody-8746fdc0c095c97e529f65c022e000da872bffa5.tar.gz prosody-8746fdc0c095c97e529f65c022e000da872bffa5.zip |
mod_motd: Remove redundant conditions
The stanza should always be like this in the presence/initial event
Diffstat (limited to 'plugins/mod_motd.lua')
-rw-r--r-- | plugins/mod_motd.lua | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/mod_motd.lua b/plugins/mod_motd.lua index 13bc7e31..c68e77a8 100644 --- a/plugins/mod_motd.lua +++ b/plugins/mod_motd.lua @@ -18,12 +18,10 @@ local st = require "util.stanza"; motd_text = motd_text:gsub("^%s*(.-)%s*$", "%1"):gsub("\n[ \t]+", "\n"); -- Strip indentation from the config module:hook("presence/initial", function (event) - local session, stanza = event.origin, event.stanza; - if not stanza.attr.type and not stanza.attr.to then - local motd_stanza = - st.message({ to = session.full_jid, from = motd_jid }) - :tag("body"):text(motd_text); - module:send(motd_stanza); - module:log("debug", "MOTD send to user %s", session.full_jid); - end + local session, stanza = event.origin, event.stanza; + local motd_stanza = + st.message({ to = session.full_jid, from = motd_jid }) + :tag("body"):text(motd_text); + module:send(motd_stanza); + module:log("debug", "MOTD send to user %s", session.full_jid); end, 1); |