Changeset

4009:362997ededb1

mod_smacks: don't send error replys for error stanzas on session timeout
author tmolitor <thilo@eightysoft.de>
date Fri, 01 May 2020 22:24:10 +0200
parents 4008:ec9011df2dc6
children 4010:ae27f3359df8
files mod_smacks/mod_smacks.lua
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mod_smacks/mod_smacks.lua	Fri May 01 11:34:43 2020 +0200
+++ b/mod_smacks/mod_smacks.lua	Fri May 01 22:24:10 2020 +0200
@@ -407,12 +407,14 @@
 		session.outgoing_stanza_queue = {};
 		for i=1,#queue do
 			if not module:fire_event("delivery/failure", { session = session, stanza = queue[i] }) then
-				local reply = st.reply(queue[i]);
-				if reply.attr.to ~= session.full_jid then
-					reply.attr.type = "error";
-					reply:tag("error", error_attr)
-						:tag("recipient-unavailable", {xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas"});
-					core_process_stanza(session, reply);
+				if queue[i].attr.type ~= "error" then
+					local reply = st.reply(queue[i]);
+					if reply.attr.to ~= session.full_jid then
+						reply.attr.type = "error";
+						reply:tag("error", error_attr)
+							:tag("recipient-unavailable", {xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas"});
+						core_process_stanza(session, reply);
+					end
 				end
 			end
 		end