61 if #user.top_resources == 0 then user.top_resources = nil; end |
61 if #user.top_resources == 0 then user.top_resources = nil; end |
62 end |
62 end |
63 end |
63 end |
64 |
64 |
65 function handle_normal_presence(origin, stanza, core_route_stanza) |
65 function handle_normal_presence(origin, stanza, core_route_stanza) |
|
66 if full_sessions[origin.full_jid] then -- if user is still connected |
|
67 origin.send(stanza); -- reflect their presence back to them |
|
68 end |
66 local roster = origin.roster; |
69 local roster = origin.roster; |
67 local node, host = origin.username, origin.host; |
70 local node, host = origin.username, origin.host; |
68 local user = bare_sessions[node.."@"..host]; |
71 local user = bare_sessions[node.."@"..host]; |
69 for _, res in pairs(user and user.sessions or NULL) do -- broadcast to all resources |
72 for _, res in pairs(user and user.sessions or NULL) do -- broadcast to all resources |
70 if res ~= origin and res.presence then -- to resource |
73 if res ~= origin and res.presence then -- to resource |