# HG changeset patch # User Kim Alvefur # Date 1631470646 -7200 # Node ID 41af102c71903e9795dbbee4c8c6c93c85aadeee # Parent 5d925f340ae69cd90b5d6b368ae01e56240efec6 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. diff -r 5d925f340ae6 -r 41af102c7190 plugins/mod_mam/mod_mam.lua --- a/plugins/mod_mam/mod_mam.lua Sun Sep 12 17:03:02 2021 +0200 +++ b/plugins/mod_mam/mod_mam.lua Sun Sep 12 20:17:26 2021 +0200 @@ -481,10 +481,8 @@ module:hook("message/offline/handle", function(event) local stanza = event.stanza; local user = event.username .. "@" .. host; - for st_id in stanza:childtags("stanza-id", xmlns_st_id) do - if st_id.attr.by == user then - return true; - end + if stanza:get_child_with_attr("stanza-id", xmlns_st_id, "by", user) then + return true; end end, -2);