mod_http_muc_log: Use stanza:find to save a few bytes
authorKim Alvefur <zash@zash.se>
Tue, 16 Aug 2022 01:45:28 +0200
changeset 4997 f36d15107c15
parent 4996 ed5abb8b8fa8
child 4998 cce12a660b98
mod_http_muc_log: Use stanza:find to save a few bytes Why don't we have a stanza:get_child_attr(name, namespace, attrname) ?
mod_http_muc_log/mod_http_muc_log.lua
--- a/mod_http_muc_log/mod_http_muc_log.lua	Tue Aug 16 01:41:45 2022 +0200
+++ b/mod_http_muc_log/mod_http_muc_log.lua	Tue Aug 16 01:45:28 2022 +0200
@@ -389,7 +389,7 @@
 		end
 
 		-- XEP-0461: Message Replies
-		local reply = item:get_child("reply", "urn:xmpp:reply:0");
+		local reply = item:find("{urn:xmpp:reply:0}reply@id");
 
 		if body or verb or oob then
 			local line = {
@@ -405,7 +405,7 @@
 				st_name = item.name;
 				st_type = item.attr.type;
 				edit = edit;
-				reply = reply and reply.attr.id;
+				reply = reply;
 				-- COMPAT
 				key = archive_id;
 			};