Diff

plugins/mod_carbons.lua @ 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
parent 11260:08b397c21805
child 11836:8ccb22c0fa56
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";