Software /
code /
prosody
Comparison
plugins/mod_smacks.lua @ 12527:923d6fe5ee41
Merge 0.12->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 27 May 2022 15:08:55 +0200 |
parent | 12524:dd5ab9a6b599 |
parent | 12526:252ed01896dd |
child | 12528:8e780079a424 |
comparison
equal
deleted
inserted
replaced
12524:dd5ab9a6b599 | 12527:923d6fe5ee41 |
---|---|
54 local new_id = require "util.id".short; | 54 local new_id = require "util.id".short; |
55 local watchdog = require "util.watchdog"; | 55 local watchdog = require "util.watchdog"; |
56 local it = require"util.iterators"; | 56 local it = require"util.iterators"; |
57 | 57 |
58 local sessionmanager = require "core.sessionmanager"; | 58 local sessionmanager = require "core.sessionmanager"; |
59 local core_process_stanza = prosody.core_process_stanza; | |
60 | 59 |
61 local xmlns_errors = "urn:ietf:params:xml:ns:xmpp-stanzas"; | 60 local xmlns_errors = "urn:ietf:params:xml:ns:xmpp-stanzas"; |
62 local xmlns_delay = "urn:xmpp:delay"; | 61 local xmlns_delay = "urn:xmpp:delay"; |
63 local xmlns_mam2 = "urn:xmpp:mam:2"; | 62 local xmlns_mam2 = "urn:xmpp:mam:2"; |
64 local xmlns_sm2 = "urn:xmpp:sm:2"; | 63 local xmlns_sm2 = "urn:xmpp:sm:2"; |
424 tx_dropped_stanzas:sample(unacked); | 423 tx_dropped_stanzas:sample(unacked); |
425 session.smacks = false; -- Disable queueing | 424 session.smacks = false; -- Disable queueing |
426 session.outgoing_stanza_queue = nil; | 425 session.outgoing_stanza_queue = nil; |
427 for stanza in queue._queue:consume() do | 426 for stanza in queue._queue:consume() do |
428 if not module:fire_event("delivery/failure", { session = session, stanza = stanza }) then | 427 if not module:fire_event("delivery/failure", { session = session, stanza = stanza }) then |
429 if stanza.attr.type ~= "error" and stanza.attr.to ~= session.full_jid then | 428 if stanza.attr.type ~= "error" and stanza.attr.from ~= session.full_jid then |
430 local reply = st.error_reply(stanza, "cancel", "recipient-unavailable"); | 429 local reply = st.error_reply(stanza, "cancel", "recipient-unavailable"); |
431 core_process_stanza(session, reply); | 430 module:send(reply); |
432 end | 431 end |
433 end | 432 end |
434 end | 433 end |
435 end | 434 end |
436 end | 435 end |