mod_http_muc_log/mod_http_muc_log.lua
changeset 4993 b74d592df9e2
parent 4991 8a8ec909ac20
child 4994 d55b10878e43
--- a/mod_http_muc_log/mod_http_muc_log.lua	Mon Aug 15 15:26:14 2022 +0200
+++ b/mod_http_muc_log/mod_http_muc_log.lua	Tue Aug 16 01:27:59 2022 +0200
@@ -348,9 +348,7 @@
 		if edit then
 			local found = false;
 			for n = i-1, 1, -1 do
-				if not logs[n] then
-					break; -- Probably reached logs[0]
-				elseif logs[n].id == edit and nick == logs[n].nick then
+				if logs[n].id == edit and nick == logs[n].nick then
 					found = true;
 					logs[n].edited = key;
 					edit = logs[n].key;
@@ -369,9 +367,7 @@
 			-- COMPAT Movim uses an @to attribute instead of the correct @id
 			local target_id = reactions.attr.id or reactions.attr.to;
 			for n = i - 1, 1, -1 do
-				if not logs[n] then
-					break -- Probably reached logs[0]
-				elseif logs[n].key == target_id then
+				if logs[n].key == target_id then
 					local react_map = logs[n].reactions; -- { string : integer }
 					if not react_map then
 						react_map = {};