Software /
code /
prosody
Comparison
plugins/mod_presence.lua @ 2643:21eb99b06f4d
mod_presence: Reflect the user's own presence back to them.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Mon, 15 Feb 2010 04:15:37 +0500 |
parent | 2593:06995c8bfe80 |
child | 2644:c75c22c316d6 |
child | 2923:b7049746bd29 |
comparison
equal
deleted
inserted
replaced
2642:333d7e2033b2 | 2643:21eb99b06f4d |
---|---|
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 |