aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_motd.lua
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
commit7b8cd854ff846828af87c52756ddc0fa0dbe149b (patch)
tree576b1a8329e046335109ae6aa28ae1d21818bb62 /plugins/mod_motd.lua
parentb7033ea7312aff393176c927d4fd067fc7f9f7ea (diff)
downloadprosody-7b8cd854ff846828af87c52756ddc0fa0dbe149b.tar.gz
prosody-7b8cd854ff846828af87c52756ddc0fa0dbe149b.zip
mod_motd: Don't trigger on directed presence or stanzas from s2s.
Diffstat (limited to 'plugins/mod_motd.lua')
-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);