aboutsummaryrefslogtreecommitdiff
path: root/telem.lua
diff options
context:
space:
mode:
authorSolderpunk <solderpunk@sdf.org>2018-12-10 20:38:35 +0000
committerSolderpunk <solderpunk@sdf.org>2018-12-10 20:38:35 +0000
commit5359abb46ac51eff797c6ba3cb65458b84180659 (patch)
tree65e581ff358c18ec04420b093f8a9c618a8c7ffc /telem.lua
parentInitial implementation of coloured output. (diff)
Don't count a thread as updated if the most recent post was made by the current user.
Diffstat (limited to 'telem.lua')
-rwxr-xr-xtelem.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/telem.lua b/telem.lua
index 33909bd..4e37899 100755
--- a/telem.lua
+++ b/telem.lua
@@ -114,9 +114,11 @@ function get_threads(board)
local posts = get_posts(thread)
thread.post_count = #posts
thread.updated = 0
+ thread.updated_by = ""
for _, post in ipairs(posts) do
if post.timestamp > thread.updated then
thread.updated = post.timestamp
+ thread.updated_by = post.author
end
end
table.insert(threads, thread)
@@ -330,7 +332,7 @@ function do_scan()
local threads = get_threads(board)
local updated_threads = 0
for _, thread in ipairs(threads) do
- if thread.updated > board.last_scanned then
+ if thread.updated > board.last_scanned and thread.updated_by ~= username then
updated_threads = updated_threads + 1
end
end