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 |