Comparison

core/stanza_router.lua @ 1273:85353014ff34

stanza_router: Reply with an error on groupchat messages to bare JID
author Waqas Hussain <waqas20@gmail.com>
date Mon, 01 Jun 2009 17:53:39 +0500
parent 1270:0e700e2041ef
child 1292:b18c1ad7fcb6
comparison
equal deleted inserted replaced
1272:28f9041d8c55 1273:85353014ff34
242 for _, session in pairs(user.sessions) do -- find resource with greatest priority 242 for _, session in pairs(user.sessions) do -- find resource with greatest priority
243 if session.presence and session.priority >= 0 then 243 if session.presence and session.priority >= 0 then
244 session.send(stanza); 244 session.send(stanza);
245 end 245 end
246 end 246 end
247 elseif resource and stanza.attr.type == 'groupchat' then 247 elseif stanza.attr.type == 'groupchat' then
248 -- Groupchat message sent to offline resource 248 -- Groupchat message sent to offline resource
249 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); 249 origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
250 else 250 else
251 local count = 0; 251 local count = 0;
252 for _, session in ipairs(select_best_resources(user)) do 252 for _, session in ipairs(select_best_resources(user)) do