comparison mod_ircd/mod_ircd.lua @ 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 fd7f7ebf257e
children 1849614af19a
comparison
equal deleted inserted replaced
150:fd7f7ebf257e 151:5abf15351b9a
120 if joined_mucs[from_node] and from_bare == from then 120 if joined_mucs[from_node] and from_bare == from then
121 -- From room itself 121 -- From room itself
122 local joined_muc = joined_mucs[from_node]; 122 local joined_muc = joined_mucs[from_node];
123 if stanza.name == "message" then 123 if stanza.name == "message" then
124 local subject = stanza:get_child("subject"); 124 local subject = stanza:get_child("subject");
125 subject = subject and (subject:get_text() or "");
125 if subject then 126 if subject then
126 local subject_text = subject:get_text();
127 for session in pairs(joined_muc.sessions) do 127 for session in pairs(joined_muc.sessions) do
128 session.send(":"..session.host.." 332 "..session.nick.." "..from_node.." :"..subject_text); 128 session.send(":"..session.host.." 332 "..session.nick.." "..from_node.." :"..subject);
129 end 129 end
130 end 130 end
131 end 131 end
132 elseif joined_mucs[from_node] then 132 elseif joined_mucs[from_node] then
133 -- From room occupant 133 -- From room occupant