aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2012-10-13 15:21:59 +0200
committerKim Alvefur <zash@zash.se>2012-10-13 15:21:59 +0200
commitda0876f26f4ee0a706e5c5fcc45d469f23aeabc8 (patch)
tree576b1a8329e046335109ae6aa28ae1d21818bb62
parentf875ce793f8c0a8ad7f671420df1d9746f61d12d (diff)
downloadprosody-da0876f26f4ee0a706e5c5fcc45d469f23aeabc8.tar.gz
prosody-da0876f26f4ee0a706e5c5fcc45d469f23aeabc8.zip
mod_motd: Don't trigger on directed presence or stanzas from s2s.
-rw-r--r--plugins/mod_motd.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/mod_motd.lua b/plugins/mod_motd.lua
index ddde9c78..fea2cb85 100644
--- a/plugins/mod_motd.lua
+++ b/plugins/mod_motd.lua
@@ -20,7 +20,8 @@ motd_text = motd_text:gsub("^%s*(.-)%s*$", "%1"):gsub("\n%s+", "\n"); -- Strip i
module:hook("presence/bare", function (event)
local session, stanza = event.origin, event.stanza;
- if not session.presence and not stanza.attr.type then
+ if session.username and not session.presence
+ and 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);