mod_carbons: Reduce line count using new util.stanza attr method
authorKim Alvefur <zash@zash.se>
Sun, 12 Sep 2021 20:18:04 +0200
changeset 11800 71c20650a0b4
parent 11799 41af102c7190
child 11801 72a2b85c0537
mod_carbons: Reduce line count using new util.stanza attr method
plugins/mod_carbons.lua
--- 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";