Diff

plugins/mod_motd.lua @ 5169:ed2d64fb7301

mod_motd: Don't trigger on directed presence or stanzas from s2s.
author Kim Alvefur <zash@zash.se>
date Sat, 13 Oct 2012 15:21:59 +0200
parent 5014:b2006c1cfa85
child 5371:706206e191e8
line wrap: on
line diff
--- a/plugins/mod_motd.lua	Fri Oct 12 18:49:22 2012 +0200
+++ b/plugins/mod_motd.lua	Sat Oct 13 15:21:59 2012 +0200
@@ -20,7 +20,8 @@
 
 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);