# HG changeset patch # User Kim Alvefur # Date 1478695078 -3600 # Node ID 49a01b78b45fad8ae387805f9be513b08f012e88 # Parent 51333285453112bce66279f62314e921efab9923 mod_storage_muc_log: Address luacheck warnings diff -r 513332854531 -r 49a01b78b45f mod_storage_muc_log/mod_storage_muc_log.lua --- a/mod_storage_muc_log/mod_storage_muc_log.lua Tue Nov 08 00:16:39 2016 +0100 +++ b/mod_storage_muc_log/mod_storage_muc_log.lua Wed Nov 09 13:37:58 2016 +0100 @@ -1,3 +1,4 @@ +-- luacheck: ignore 212/self 431/err local datamanager = require"core.storagemanager".olddm; local xml_parse = require"util.xml".parse; @@ -48,7 +49,9 @@ return with and tag.name .. "<" .. with or tag.name; end -function driver:append(node, key, stanza, when, with) +function driver:append(node, key, stanza, when, with) -- luacheck: ignore 212/key + -- luacheck: ignore 311/with + -- 'with' doesn't exist in the original mod_muc_log, so gets derived here if type(when) ~= "number" then when, with, stanza = stanza, when, with; end @@ -83,8 +86,6 @@ table.sort(dates); return coroutine.wrap(function () - local query = query; - local dates = dates; local start_date = query and query.start and os_date(datef, query.start) or dates[1]; local end_date = query and query["end"] and os_date(datef, query["end"]) or dates[#dates]; local start_time = query and query.start and os_date(timef, query.start) or dates[1]; @@ -120,8 +121,8 @@ inner_start = inner_start + (query and query.reverse and -1 or 1); seek_once = nil; end - for i = inner_start, inner_stop, inner_step do - item, err = data[i]; + for i = inner_start, inner_stop, inner_step do -- luacheck: ignore 423/i + item, err = data[i], nil; if item then item, err = xml_parse(item); end