From 9ae27ec538dc8c8fd3d22675b2bc228a6fc535e9 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 12 Sep 2021 20:18:04 +0200 Subject: mod_carbons: Reduce line count using new util.stanza attr method --- plugins/mod_carbons.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/mod_carbons.lua b/plugins/mod_carbons.lua index 73d25c07..77758cd7 100644 --- a/plugins/mod_carbons.lua +++ b/plugins/mod_carbons.lua @@ -60,10 +60,8 @@ local function should_copy(stanza, c2s, user_bare) --> boolean, reason: string return true, "jingle call"; end - for archived in stanza:childtags("stanza-id", "urn:xmpp:sid:0") do - if archived and archived.attr.by == user_bare then - return true, "archived"; - end + if stanza:get_child_with_attr("stanza-id", "urn:xmpp:sid:0", "by", user_bare) then + return true, "archived"; end return false, "default"; -- cgit v1.2.3