mod_s2s_blacklist: Don't send error replies for error stanzas
authorKim Alvefur <zash@zash.se>
Sat, 24 Feb 2018 19:38:10 +0100
changeset 2897 d958558e0058
parent 2896 bf9fc41bf7ad
child 2898 165d2877eeac
mod_s2s_blacklist: Don't send error replies for error stanzas
mod_s2s_blacklist/mod_s2s_blacklist.lua
--- a/mod_s2s_blacklist/mod_s2s_blacklist.lua	Fri Feb 23 22:00:18 2018 +0100
+++ b/mod_s2s_blacklist/mod_s2s_blacklist.lua	Sat Feb 24 19:38:10 2018 +0100
@@ -4,7 +4,9 @@
 
 module:hook("route/remote", function (event)
 	if blacklist:contains(event.to_host) then
-		module:send(st.error_reply(event.stanza, "cancel", "not-allowed", "Communication with this domain is restricted"));
+		if event.stanza.attr.type ~= "error" then
+			module:send(st.error_reply(event.stanza, "cancel", "not-allowed", "Communication with this domain is restricted"));
+		end
 		return true;
 	end
 end, 100);