# HG changeset patch # User Kim Alvefur # Date 1660606467 -7200 # Node ID d55b10878e439e0dfee50b86d4eb2aa47846a13d # Parent b74d592df9e2f8e3af1e3437459b629780a08847 mod_http_muc_log: Rename variable for improved clarity diff -r b74d592df9e2 -r d55b10878e43 mod_http_muc_log/mod_http_muc_log.lua --- a/mod_http_muc_log/mod_http_muc_log.lua Tue Aug 16 01:27:59 2022 +0200 +++ b/mod_http_muc_log/mod_http_muc_log.lua Tue Aug 16 01:34:27 2022 +0200 @@ -305,7 +305,7 @@ end local first, last; - for key, item, when in iter do + for archive_id, item, when in iter do local body_tag = item:get_child("body"); local body = body_tag and body_tag:get_text(); local subject = item:get_child_text("subject"); @@ -348,10 +348,10 @@ if edit then local found = false; for n = i-1, 1, -1 do - if logs[n].id == edit and nick == logs[n].nick then + if logs[n].message_id == edit and nick == logs[n].nick then found = true; - logs[n].edited = key; - edit = logs[n].key; + logs[n].edited = archive_id; + edit = logs[n].archive_id; break; end end @@ -367,7 +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 logs[n].key == target_id then + if logs[n].archive_id == target_id then local react_map = logs[n].reactions; -- { string : integer } if not react_map then react_map = {}; @@ -389,8 +389,8 @@ if body or verb or oob then local line = { - id = item.attr.id, - key = key; + message_id = item.attr.id; + archive_id = archive_id; datetime = datetime.datetime(when); time = datetime.time(when); verb = verb; @@ -401,6 +401,8 @@ st_type = item.attr.type; edit = edit; reply = reply and reply.attr.id; + -- COMPAT + key = archive_id; }; if oob then line.oob = { @@ -411,8 +413,8 @@ logs[i], i = line, i + 1; end - first = first or key; - last = key; + first = first or archive_id; + last = archive_id; end if i == 1 and not lazy then return end -- No items diff -r b74d592df9e2 -r d55b10878e43 mod_http_muc_log/res/http_muc_log.html --- a/mod_http_muc_log/res/http_muc_log.html Tue Aug 16 01:27:59 2022 +0200 +++ b/mod_http_muc_log/res/http_muc_log.html Tue Aug 16 01:34:27 2022 +0200 @@ -110,8 +110,8 @@
    {lines# -
  1. - +
  2. + {item.nick} {item.verb?} {item.edited&}{item.body?}{item.edited& }{item.edit& }{item.reply& }