Changeset

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 12527:923d6fe5ee41
children 12529:7dae6d29b71d
files plugins/mod_smacks.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_smacks.lua	Fri May 27 15:08:55 2022 +0200
+++ b/plugins/mod_smacks.lua	Fri May 27 14:54:32 2022 +0200
@@ -420,13 +420,14 @@
 	local queue = session.outgoing_stanza_queue;
 	local unacked = queue:count_unacked()
 	if unacked > 0 then
+		local error_from = jid.join(session.username, session.host or module.host);
 		tx_dropped_stanzas:sample(unacked);
 		session.smacks = false; -- Disable queueing
 		session.outgoing_stanza_queue = nil;
 		for stanza in queue._queue:consume() do
 			if not module:fire_event("delivery/failure", { session = session, stanza = stanza }) then
 				if stanza.attr.type ~= "error" and stanza.attr.from ~= session.full_jid then
-					local reply = st.error_reply(stanza, "cancel", "recipient-unavailable");
+					local reply = st.error_reply(stanza, "cancel", "recipient-unavailable", nil, error_from);
 					module:send(reply);
 				end
 			end