changeset 212:16b76c7b6316

fixed broadcast PRIVMSG bug
author Bjoern Kalkbrenner <terminar@cyberphoria.org>
date Wed, 14 Jul 2010 14:57:40 +0200 (2010-07-14)
parents 35314bf3410a
children 89051a926f74
files mod_ircd/mod_ircd.lua
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
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