Comparison

plugins/mod_mam/mod_mam.lua @ 11795:41af102c7190

mod_mam: Reduce line count using new util.stanza attr method Since this stanza-id was generated elsewhere in mod_mam, there should be no need for normalization.
author Kim Alvefur <zash@zash.se>
date Sun, 12 Sep 2021 20:17:26 +0200
parent 11760:d66738eeb875
child 11819:f590e3c51eff
comparison
equal deleted inserted replaced
11794:5d925f340ae6 11795:41af102c7190
479 -- disabled. Otherwise the message would generate a delivery failure report, 479 -- disabled. Otherwise the message would generate a delivery failure report,
480 -- which would not be accurate because it has been archived. 480 -- which would not be accurate because it has been archived.
481 module:hook("message/offline/handle", function(event) 481 module:hook("message/offline/handle", function(event)
482 local stanza = event.stanza; 482 local stanza = event.stanza;
483 local user = event.username .. "@" .. host; 483 local user = event.username .. "@" .. host;
484 for st_id in stanza:childtags("stanza-id", xmlns_st_id) do 484 if stanza:get_child_with_attr("stanza-id", xmlns_st_id, "by", user) then
485 if st_id.attr.by == user then 485 return true;
486 return true;
487 end
488 end 486 end
489 end, -2); 487 end, -2);
490 488
491 -- Don't broadcast offline messages to clients that have queried the archive. 489 -- Don't broadcast offline messages to clients that have queried the archive.
492 module:hook("message/offline/broadcast", function (event) 490 module:hook("message/offline/broadcast", function (event)