Comparison

core/stanza_router.lua @ 4816:897ec7dcdaa6

stanza_router: Allow route/remote handlers to return false to block a stanza
author Matthew Wild <mwild1@gmail.com>
date Fri, 04 May 2012 01:46:54 +0100
parent 4554:6ceabde7af91
child 4817:9cc1d3e49f19
comparison
equal deleted inserted replaced
4815:04e6115e060b 4816:897ec7dcdaa6
190 else 190 else
191 local xmlns = stanza.attr.xmlns; 191 local xmlns = stanza.attr.xmlns;
192 stanza.attr.xmlns = nil; 192 stanza.attr.xmlns = nil;
193 local routed = prosody.events.fire_event("route/remote", { origin = origin, stanza = stanza, from_host = from_host, to_host = host }); --FIXME: Should be per-host (shared modules!) 193 local routed = prosody.events.fire_event("route/remote", { origin = origin, stanza = stanza, from_host = from_host, to_host = host }); --FIXME: Should be per-host (shared modules!)
194 stanza.attr.xmlns = xmlns; -- reset 194 stanza.attr.xmlns = xmlns; -- reset
195 if routed == nil then 195 if not routed then
196 core_route_stanza(hosts[from_host], st.error_reply(stanza, "cancel", "not-allowed", "Communication with remote domains is not enabled")); 196 core_route_stanza(hosts[from_host], st.error_reply(stanza, "cancel", "not-allowed", "Communication with remote domains is not enabled"));
197 end 197 end
198 end 198 end
199 end 199 end
200 end 200 end