Comparison

mod_ircd/mod_ircd.lua @ 150:fd7f7ebf257e

mod_ircd: Fixed handling of empty <body/> elements.
author Waqas Hussain <waqas20@gmail.com>
date Thu, 13 May 2010 14:45:10 +0500
parent 132:d4ff1cd414e5
child 151:5abf15351b9a
comparison
equal deleted inserted replaced
149:b8a89ebf71e3 150:fd7f7ebf257e
150 session.send(":"..nick.."!"..nick.." "..what.." :"..from_node); 150 session.send(":"..nick.."!"..nick.." "..what.." :"..from_node);
151 end 151 end
152 end 152 end
153 elseif stanza.name == "message" then 153 elseif stanza.name == "message" then
154 local body = stanza:get_child("body"); 154 local body = stanza:get_child("body");
155 body = body and body:get_text() or "";
155 local hasdelay = stanza:get_child("delay", "urn:xmpp:delay"); 156 local hasdelay = stanza:get_child("delay", "urn:xmpp:delay");
156 if body then 157 if body ~= "" then
157 for session in pairs(joined_muc.sessions) do 158 for session in pairs(joined_muc.sessions) do
158 if nick ~= session.nick or hasdelay then 159 if nick ~= session.nick or hasdelay then
159 session.send(":"..nick.." PRIVMSG "..from_node.." :"..body:get_text()); 160 session.send(":"..nick.." PRIVMSG "..from_node.." :"..body);
160 end 161 end
161 end 162 end
162 end 163 end
163 end 164 end
164 end 165 end