Comparison

core/stanza_router.lua @ 774:4885c6e101b4

stanza_router: Fix for when clients don't specify priority in initial presence
author Matthew Wild <mwild1@gmail.com>
date Mon, 09 Feb 2009 13:48:11 +0000
parent 760:90ce865eebd8
child 785:31d5be1371cf
comparison
equal deleted inserted replaced
773:c36edc1934c5 774:4885c6e101b4
200 end 200 end
201 elseif stanza.name == "message" then -- select a resource to recieve message 201 elseif stanza.name == "message" then -- select a resource to recieve message
202 local priority = 0; 202 local priority = 0;
203 local recipients = {}; 203 local recipients = {};
204 for _, session in pairs(user.sessions) do -- find resource with greatest priority 204 for _, session in pairs(user.sessions) do -- find resource with greatest priority
205 local p = session.priority; 205 local p = session.priority or -1;
206 if p > priority then 206 if p > priority then
207 priority = p; 207 priority = p;
208 recipients = {session}; 208 recipients = {session};
209 elseif p == priority then 209 elseif p == priority then
210 t_insert(recipients, session); 210 t_insert(recipients, session);