Diff

mod_ircd/mod_ircd.lua @ 212:16b76c7b6316

fixed broadcast PRIVMSG bug
author Bjoern Kalkbrenner <terminar@cyberphoria.org>
date Wed, 14 Jul 2010 14:57:40 +0200
parent 211:35314bf3410a
child 236:24582ea48471
line wrap: on
line diff
--- a/mod_ircd/mod_ircd.lua	Wed Jul 14 14:27:40 2010 +0200
+++ b/mod_ircd/mod_ircd.lua	Wed Jul 14 14:57:40 2010 +0200
@@ -159,10 +159,10 @@
 			body = body and body:get_text() or "";
 			local hasdelay = stanza:get_child("delay", "urn:xmpp:delay");
 			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
+				local to_nick = jid.split(stanza.attr.to);
+				local session = nicks[to_nick];
+				if nick ~= session.nick or hasdelay then
+				    session.send(":"..nick.." PRIVMSG "..from_node.." :"..body);
 				end
 			end
 			if not nick then