aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-09-12 20:18:04 +0200
committerKim Alvefur <zash@zash.se>2021-09-12 20:18:04 +0200
commit9ae27ec538dc8c8fd3d22675b2bc228a6fc535e9 (patch)
tree0838e5f5150e22b43c79dcca79477331330f0de9 /plugins
parent738ff2a5f9a7453d3eb851cd52b359f5a4418bfa (diff)
downloadprosody-9ae27ec538dc8c8fd3d22675b2bc228a6fc535e9.tar.gz
prosody-9ae27ec538dc8c8fd3d22675b2bc228a6fc535e9.zip
mod_carbons: Reduce line count using new util.stanza attr method
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_carbons.lua6
1 files 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";