aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-12-03 00:59:23 +0100
committerKim Alvefur <zash@zash.se>2021-12-03 00:59:23 +0100
commit9f22150bc88fdaf58d80a3e71e4bbf8a0b49dc77 (patch)
tree8d1cc84c2175f8aca3c0d6f90004d873cec1b126
parent6f3409f3f24c3f1d73ef255a622d6c2251f2bd42 (diff)
downloadprosody-9f22150bc88fdaf58d80a3e71e4bbf8a0b49dc77.tar.gz
prosody-9f22150bc88fdaf58d80a3e71e4bbf8a0b49dc77.zip
mod_smacks: Use function to construct error reply
Did error_reply() not exist when mod_smacks was first created?
-rw-r--r--plugins/mod_smacks.lua6
1 files changed, 1 insertions, 5 deletions
diff --git a/plugins/mod_smacks.lua b/plugins/mod_smacks.lua
index af54bdc4..c9b01371 100644
--- a/plugins/mod_smacks.lua
+++ b/plugins/mod_smacks.lua
@@ -395,17 +395,13 @@ module:hook_tag(xmlns_sm3, "a", handle_a);
local function handle_unacked_stanzas(session)
local queue = session.outgoing_stanza_queue;
- local error_attr = { type = "cancel" };
if #queue > 0 then
session.outgoing_stanza_queue = {};
for i=1,#queue do
if not module:fire_event("delivery/failure", { session = session, stanza = queue[i] }) then
if queue[i].attr.type ~= "error" then
- local reply = st.reply(queue[i]);
+ local reply = st.error_reply(queue[i], "cancel", "recipient-unavailable");
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