diff mod_ircd/mod_ircd.lua @ 154:1849614af19a

mod_ircd: Log error when receiving a message without a valid nick
author Matthew Wild <mwild1@gmail.com>
date Wed, 19 May 2010 14:11:34 +0100
parents 5abf15351b9a
children 35314bf3410a
line wrap: on
line diff
--- a/mod_ircd/mod_ircd.lua	Wed May 19 14:02:19 2010 +0100
+++ b/mod_ircd/mod_ircd.lua	Wed May 19 14:11:34 2010 +0100
@@ -154,13 +154,16 @@
 			local body = stanza:get_child("body");
 			body = body and body:get_text() or "";
 			local hasdelay = stanza:get_child("delay", "urn:xmpp:delay");
-			if body ~= "" then
+			if body ~= "" and nick then
 				for session in pairs(joined_muc.sessions) do
 					if nick ~= session.nick or hasdelay then
 						session.send(":"..nick.." PRIVMSG "..from_node.." :"..body);
 					end
 				end
 			end
+			if not nick then
+				module:log("error", "Invalid nick from JID: %s", from);
+			end
 		end
 	end
 end