comparison mod_smacks/mod_smacks.lua @ 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 9ec23a457f9a
children 22e7b3d6fcae
comparison
equal deleted inserted replaced
4008:ec9011df2dc6 4009:362997ededb1
405 local error_attr = { type = "cancel" }; 405 local error_attr = { type = "cancel" };
406 if #queue > 0 then 406 if #queue > 0 then
407 session.outgoing_stanza_queue = {}; 407 session.outgoing_stanza_queue = {};
408 for i=1,#queue do 408 for i=1,#queue do
409 if not module:fire_event("delivery/failure", { session = session, stanza = queue[i] }) then 409 if not module:fire_event("delivery/failure", { session = session, stanza = queue[i] }) then
410 local reply = st.reply(queue[i]); 410 if queue[i].attr.type ~= "error" then
411 if reply.attr.to ~= session.full_jid then 411 local reply = st.reply(queue[i]);
412 reply.attr.type = "error"; 412 if reply.attr.to ~= session.full_jid then
413 reply:tag("error", error_attr) 413 reply.attr.type = "error";
414 :tag("recipient-unavailable", {xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas"}); 414 reply:tag("error", error_attr)
415 core_process_stanza(session, reply); 415 :tag("recipient-unavailable", {xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas"});
416 core_process_stanza(session, reply);
417 end
416 end 418 end
417 end 419 end
418 end 420 end
419 end 421 end
420 end 422 end