comparison plugins/mod_mam/mod_mam.lua @ 10740:08efb60faf67

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.
author Kim Alvefur <zash@zash.se>
date Tue, 21 Apr 2020 01:29:58 +0200
parents 50f0a4d83731
children 27f1fcd85ccd
comparison
equal deleted inserted replaced
10739:50f0a4d83731 10740:08efb60faf67
264 end 264 end
265 265
266 local function should_store(stanza) --> boolean, reason: string 266 local function should_store(stanza) --> boolean, reason: string
267 local st_type = stanza.attr.type or "normal"; 267 local st_type = stanza.attr.type or "normal";
268 local st_to_full = (stanza.attr.to or ""):find("/"); 268 local st_to_full = (stanza.attr.to or ""):find("/");
269 if st_type == "error" then
270 st_to_full = (stanza.attr.from or ""):find("/");
271 end
269 272
270 if st_type == "headline" then 273 if st_type == "headline" then
271 -- Headline messages are ephemeral by definition 274 -- Headline messages are ephemeral by definition
272 return false, "headline"; 275 return false, "headline";
273 end 276 end