Changeset

151:5abf15351b9a

mod_ircd: Fixed handling of empty <subject/> elements.
author Waqas Hussain <waqas20@gmail.com>
date Thu, 13 May 2010 21:28:10 +0500
parents 150:fd7f7ebf257e
children 152:4ca382e8a4c5
files mod_ircd/mod_ircd.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_ircd/mod_ircd.lua	Thu May 13 14:45:10 2010 +0500
+++ b/mod_ircd/mod_ircd.lua	Thu May 13 21:28:10 2010 +0500
@@ -122,10 +122,10 @@
 		local joined_muc = joined_mucs[from_node];
 		if stanza.name == "message" then
 			local subject = stanza:get_child("subject");
+			subject = subject and (subject:get_text() or "");
 			if subject then
-				local subject_text = subject:get_text();
 				for session in pairs(joined_muc.sessions) do
-					session.send(":"..session.host.." 332 "..session.nick.." "..from_node.." :"..subject_text);
+					session.send(":"..session.host.." 332 "..session.nick.." "..from_node.." :"..subject);
 				end
 			end
 		end