Comparison

core/stanza_router.lua @ 1148:5dafbc0ded34

stanza_router: Prevent further processing of a handled stanza
author Waqas Hussain <waqas20@gmail.com>
date Fri, 15 May 2009 06:31:32 +0500
parent 1144:fbd65e966316
child 1149:72fc323050c1
comparison
equal deleted inserted replaced
1147:513c1d071045 1148:5dafbc0ded34
107 end]] -- FIXME 107 end]] -- FIXME
108 108
109 -- FIXME do stanzas not of jabber:client get handled by components? 109 -- FIXME do stanzas not of jabber:client get handled by components?
110 if (origin.type == "s2sin" or origin.type == "c2s" or origin.type == "component") and (not xmlns or xmlns == "jabber:server" or xmlns == "jabber:client") then 110 if (origin.type == "s2sin" or origin.type == "c2s" or origin.type == "component") and (not xmlns or xmlns == "jabber:server" or xmlns == "jabber:client") then
111 local event_data = {origin=origin, stanza=stanza}; 111 local event_data = {origin=origin, stanza=stanza};
112 fire_event(tostring(host or origin.host).."/"..stanza.name, event_data); 112 if fire_event(tostring(host or origin.host).."/"..stanza.name, event_data) then return; end
113 if origin.type == "s2sin" and not origin.dummy then 113 if origin.type == "s2sin" and not origin.dummy then
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?