Changeset

11796:71c20650a0b4

mod_carbons: Reduce line count using new util.stanza attr method
author Kim Alvefur <zash@zash.se>
date Sun, 12 Sep 2021 20:18:04 +0200
parents 11795:41af102c7190
children 11797:72a2b85c0537
files plugins/mod_carbons.lua
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_carbons.lua	Sun Sep 12 20:17:26 2021 +0200
+++ b/plugins/mod_carbons.lua	Sun Sep 12 20:18:04 2021 +0200
@@ -60,10 +60,8 @@
 		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";