Software /
code /
prosody
Comparison
plugins/mod_presence.lua @ 1473:d2211cbb822f
mod_presence: Eliminated a jid_split
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sun, 05 Jul 2009 11:59:51 +0500 |
parent | 1472:9b13cea9fa3e |
child | 1474:6947761fd531 |
comparison
equal
deleted
inserted
replaced
1472:9b13cea9fa3e | 1473:d2211cbb822f |
---|---|
67 if subscription == "both" or subscription == "from" then | 67 if subscription == "both" or subscription == "from" then |
68 stanza.attr.to = jid; | 68 stanza.attr.to = jid; |
69 core_route_stanza(origin, stanza); | 69 core_route_stanza(origin, stanza); |
70 end | 70 end |
71 end | 71 end |
72 local node, host = jid_split(stanza.attr.from); | 72 local node, host = origin.username, origin.host; |
73 for _, res in pairs(hosts[host].sessions[node].sessions) do -- broadcast to all resources | 73 for _, res in pairs(hosts[host].sessions[node].sessions) do -- broadcast to all resources |
74 if res ~= origin and res.presence then -- to resource | 74 if res ~= origin and res.presence then -- to resource |
75 stanza.attr.to = res.full_jid; | 75 stanza.attr.to = res.full_jid; |
76 core_route_stanza(origin, stanza); | 76 core_route_stanza(origin, stanza); |
77 end | 77 end |