aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_mam
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-04-21 01:29:58 +0200
committerKim Alvefur <zash@zash.se>2020-04-21 01:29:58 +0200
commit230ceb086948cd12c258ca78cfbf8a345904fd8e (patch)
tree9000c15bf06e16e19d33f07abb3b374a6e1071c4 /plugins/mod_mam
parent3dcfe11e54b8c4f936b701f9e57843fce39500f9 (diff)
downloadprosody-230ceb086948cd12c258ca78cfbf8a345904fd8e.tar.gz
prosody-230ceb086948cd12c258ca78cfbf8a345904fd8e.zip
mod_mam: Check sender of error instead of receiver
The intent is to capture errors to stanzas sent by the local user, so that they can see why a message failed to be delivered even if the error came after they went offline.
Diffstat (limited to 'plugins/mod_mam')
-rw-r--r--plugins/mod_mam/mod_mam.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua
index 6e522d73..db0e7f8d 100644
--- a/plugins/mod_mam/mod_mam.lua
+++ b/plugins/mod_mam/mod_mam.lua
@@ -266,6 +266,9 @@ end
local function should_store(stanza) --> boolean, reason: string
local st_type = stanza.attr.type or "normal";
local st_to_full = (stanza.attr.to or ""):find("/");
+ if st_type == "error" then
+ st_to_full = (stanza.attr.from or ""):find("/");
+ end
if st_type == "headline" then
-- Headline messages are ephemeral by definition