Mercurial > prosody-hg
comparison plugins/mod_smacks.lua @ 12528:8e780079a424
mod_smacks: Indicate that bounces are generated by the server
Could arguably be implied by 'recipient-unavailable' since if it was
available, this error wouldn't happen.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 27 May 2022 14:54:32 +0200 |
| parents | 923d6fe5ee41 |
| children | 12962a1001c2 |
comparison
equal
deleted
inserted
replaced
| 12527:923d6fe5ee41 | 12528:8e780079a424 |
|---|---|
| 418 | 418 |
| 419 local function handle_unacked_stanzas(session) | 419 local function handle_unacked_stanzas(session) |
| 420 local queue = session.outgoing_stanza_queue; | 420 local queue = session.outgoing_stanza_queue; |
| 421 local unacked = queue:count_unacked() | 421 local unacked = queue:count_unacked() |
| 422 if unacked > 0 then | 422 if unacked > 0 then |
| 423 local error_from = jid.join(session.username, session.host or module.host); | |
| 423 tx_dropped_stanzas:sample(unacked); | 424 tx_dropped_stanzas:sample(unacked); |
| 424 session.smacks = false; -- Disable queueing | 425 session.smacks = false; -- Disable queueing |
| 425 session.outgoing_stanza_queue = nil; | 426 session.outgoing_stanza_queue = nil; |
| 426 for stanza in queue._queue:consume() do | 427 for stanza in queue._queue:consume() do |
| 427 if not module:fire_event("delivery/failure", { session = session, stanza = stanza }) then | 428 if not module:fire_event("delivery/failure", { session = session, stanza = stanza }) then |
| 428 if stanza.attr.type ~= "error" and stanza.attr.from ~= session.full_jid then | 429 if stanza.attr.type ~= "error" and stanza.attr.from ~= session.full_jid then |
| 429 local reply = st.error_reply(stanza, "cancel", "recipient-unavailable"); | 430 local reply = st.error_reply(stanza, "cancel", "recipient-unavailable", nil, error_from); |
| 430 module:send(reply); | 431 module:send(reply); |
| 431 end | 432 end |
| 432 end | 433 end |
| 433 end | 434 end |
| 434 end | 435 end |
