changeset 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 31e24026e4fd
children 7a037cb5ab9e
files mod_ircd/mod_ircd.lua
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
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