aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-09-12 20:17:26 +0200
committerKim Alvefur <zash@zash.se>2021-09-12 20:17:26 +0200
commit738ff2a5f9a7453d3eb851cd52b359f5a4418bfa (patch)
treeaf457153865ba915d1e87248f3ed72ef3c71891c
parent9af7bb723b3964a1884d98bf67bcb86ef19ccf60 (diff)
downloadprosody-738ff2a5f9a7453d3eb851cd52b359f5a4418bfa.tar.gz
prosody-738ff2a5f9a7453d3eb851cd52b359f5a4418bfa.zip
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.
-rw-r--r--plugins/mod_mam/mod_mam.lua6
1 files changed, 2 insertions, 4 deletions
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);