Diff

plugins/mod_motd.lua @ 8146:5c91fb62338e

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Wed, 17 May 2017 01:06:20 +0200
parent 8135:e20c27e04ecc
child 9789:abd32bc33a9c
line wrap: on
line diff
--- a/plugins/mod_motd.lua	Wed Apr 26 11:55:27 2017 +0200
+++ b/plugins/mod_motd.lua	Wed May 17 01:06:20 2017 +0200
@@ -17,10 +17,9 @@
 
 motd_text = motd_text:gsub("^%s*(.-)%s*$", "%1"):gsub("\n[ \t]+", "\n"); -- Strip indentation from the config
 
-module:hook("presence/bare", function (event)
+module:hook("presence/initial", function (event)
 		local session, stanza = event.origin, event.stanza;
-		if session.username and not session.presence
-		and not stanza.attr.type and not stanza.attr.to then
+		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);