Skip to content
Snippets Groups Projects
Commit a4eccd4f authored by Alex Ksandra's avatar Alex Ksandra
Browse files

For future use, hard to redo things in terms of it r/n but a bit later surely possible.

parent c3af1474
No related branches found
No related tags found
1 merge request!199ShowChatLog fix
......@@ -86,9 +86,10 @@ function _M:resize(x, y, w, h)
end
--- Returns the full log
function _M:getLog(extra)
function _M:getLog(extra, timestamp)
local log = {}
for i = 1, #self.log do
for i = 1, #self.log do
if timestamp and self.log[i].timestamp <= timestamp then break end
if not extra then
log[#log+1] = self.log[i].str
else
......
......@@ -536,12 +536,13 @@ end
----------------------------------------------------------------
--- Returns the full log
function _M:getLog(channel, extra)
function _M:getLog(channel, extra, timestamp)
channel = channel or self.cur_channel
local log = {}
if self.channels[channel] then
for _, i in ipairs(self.channels[channel].log) do
local tstr
if timestamp and i.timestamp <= timestamp then break end
local tstr
if i.kind == "whisper" then
tstr = tstring{{"color", 0xcb,0x87,0xd2}, "<", i.name, "> "}
elseif i.kind == "join" then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment