--- 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