Software /
code /
prosody
Comparison
core/stanza_router.lua @ 1149:72fc323050c1
stanza_router: Remove unnecessary directed presence handling
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Fri, 15 May 2009 06:34:08 +0500 |
parent | 1148:5dafbc0ded34 |
child | 1152:4d95e8078405 |
comparison
equal
deleted
inserted
replaced
1148:5dafbc0ded34 | 1149:72fc323050c1 |
---|---|
114 local host_status = origin.hosts[from_host]; | 114 local host_status = origin.hosts[from_host]; |
115 if not host_status or not host_status.authed then -- remote server trying to impersonate some other server? | 115 if not host_status or not host_status.authed then -- remote server trying to impersonate some other server? |
116 log("warn", "Received a stanza claiming to be from %s, over a conn authed for %s!", from_host, origin.from_host); | 116 log("warn", "Received a stanza claiming to be from %s, over a conn authed for %s!", from_host, origin.from_host); |
117 return; -- FIXME what should we do here? does this work with subdomains? | 117 return; -- FIXME what should we do here? does this work with subdomains? |
118 end | 118 end |
119 end | |
120 if origin.type == "c2s" and stanza.name == "presence" and to ~= nil and not(origin.roster[to_bare] and (origin.roster[to_bare].subscription == "both" or origin.roster[to_bare].subscription == "from")) then -- directed presence | |
121 origin.directed = origin.directed or {}; | |
122 origin.directed[to] = true; | |
123 --t_insert(origin.directed, to); -- FIXME does it make more sense to add to_bare rather than to? | |
124 end | 119 end |
125 if not to then | 120 if not to then |
126 core_handle_stanza(origin, stanza); | 121 core_handle_stanza(origin, stanza); |
127 elseif hosts[to] and hosts[to].type == "local" then -- directed at a local server | 122 elseif hosts[to] and hosts[to].type == "local" then -- directed at a local server |
128 core_handle_stanza(origin, stanza); | 123 core_handle_stanza(origin, stanza); |