# HG changeset patch # User Waqas Hussain # Date 1273743910 -18000 # Node ID fd7f7ebf257efb09f7234190d6e058c525473050 # Parent b8a89ebf71e3b491fb23679c5ce3ed1b01da4e71 mod_ircd: Fixed handling of empty elements. diff -r b8a89ebf71e3 -r fd7f7ebf257e mod_ircd/mod_ircd.lua --- a/mod_ircd/mod_ircd.lua Thu Apr 15 23:57:07 2010 +0200 +++ b/mod_ircd/mod_ircd.lua Thu May 13 14:45:10 2010 +0500 @@ -152,11 +152,12 @@ end elseif stanza.name == "message" then 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 ~= "" then for session in pairs(joined_muc.sessions) do if nick ~= session.nick or hasdelay then - session.send(":"..nick.." PRIVMSG "..from_node.." :"..body:get_text()); + session.send(":"..nick.." PRIVMSG "..from_node.." :"..body); end end end