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.
--- 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);