Software /
code /
prosody
Comparison
plugins/mod_presence.lua @ 1057:2677f5a4e66b
mod_presence: Broadcast a user's presence to only the user's 'available' resources
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Fri, 24 Apr 2009 00:38:40 +0500 |
parent | 1044:41a0c76127f4 |
child | 1147:513c1d071045 |
comparison
equal
deleted
inserted
replaced
1056:09821f8ad319 | 1057:2677f5a4e66b |
---|---|
63 core_route_stanza(origin, stanza); | 63 core_route_stanza(origin, stanza); |
64 end | 64 end |
65 end | 65 end |
66 local node, host = jid_split(stanza.attr.from); | 66 local node, host = jid_split(stanza.attr.from); |
67 for _, res in pairs(hosts[host].sessions[node].sessions) do -- broadcast to all resources | 67 for _, res in pairs(hosts[host].sessions[node].sessions) do -- broadcast to all resources |
68 if res ~= origin and res.full_jid then -- to resource. FIXME is res.full_jid the correct check? Maybe it should be res.presence | 68 if res ~= origin and res.presence then -- to resource |
69 stanza.attr.to = res.full_jid; | 69 stanza.attr.to = res.full_jid; |
70 core_route_stanza(origin, stanza); | 70 core_route_stanza(origin, stanza); |
71 end | 71 end |
72 end | 72 end |
73 if stanza.attr.type == nil and not origin.presence then -- initial presence | 73 if stanza.attr.type == nil and not origin.presence then -- initial presence |