From 738ff2a5f9a7453d3eb851cd52b359f5a4418bfa Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 12 Sep 2021 20:17:26 +0200 Subject: 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. --- plugins/mod_mam/mod_mam.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'plugins/mod_mam') diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua index f0f8c4ec..43ce27f3 100644 --- a/plugins/mod_mam/mod_mam.lua +++ b/plugins/mod_mam/mod_mam.lua @@ -481,10 +481,8 @@ module:hook("pre-message/full", strip_stanza_id_after_other_events, -1); 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); -- cgit v1.2.3