mod_ircd: Fixed handling of empty <body/> elements.
--- 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