Changeset

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
parents 4815:04e6115e060b
children 4817:9cc1d3e49f19
files core/stanza_router.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/core/stanza_router.lua	Fri May 04 01:13:33 2012 +0200
+++ b/core/stanza_router.lua	Fri May 04 01:46:54 2012 +0100
@@ -192,7 +192,7 @@
 			stanza.attr.xmlns = nil;
 			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!)
 			stanza.attr.xmlns = xmlns; -- reset
-			if routed == nil then
+			if not routed then
 				core_route_stanza(hosts[from_host], st.error_reply(stanza, "cancel", "not-allowed", "Communication with remote domains is not enabled"));
 			end
 		end