comparison 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
parents 35314bf3410a
children 24582ea48471
comparison
equal deleted inserted replaced
211:35314bf3410a 212:16b76c7b6316
157 elseif stanza.name == "message" then 157 elseif stanza.name == "message" then
158 local body = stanza:get_child("body"); 158 local body = stanza:get_child("body");
159 body = body and body:get_text() or ""; 159 body = body and body:get_text() or "";
160 local hasdelay = stanza:get_child("delay", "urn:xmpp:delay"); 160 local hasdelay = stanza:get_child("delay", "urn:xmpp:delay");
161 if body ~= "" and nick then 161 if body ~= "" and nick then
162 for session in pairs(joined_muc.sessions) do 162 local to_nick = jid.split(stanza.attr.to);
163 if nick ~= session.nick or hasdelay then 163 local session = nicks[to_nick];
164 session.send(":"..nick.." PRIVMSG "..from_node.." :"..body); 164 if nick ~= session.nick or hasdelay then
165 end 165 session.send(":"..nick.." PRIVMSG "..from_node.." :"..body);
166 end 166 end
167 end 167 end
168 if not nick then 168 if not nick then
169 module:log("error", "Invalid nick from JID: %s", from); 169 module:log("error", "Invalid nick from JID: %s", from);
170 end 170 end