Hide too-new messages, and cycle between message, raw, and markdown views of messages.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4394 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-08-09 23:39:17 +00:00
parent 5c1c33d33e
commit 6ed2c702d8
2 changed files with 50 additions and 13 deletions

View File

@ -70,7 +70,7 @@ class TfTabNewsFeedElement extends LitElement {
WITH news AS (SELECT messages.*
FROM messages
JOIN json_each(?) AS following ON messages.author = following.value
WHERE messages.timestamp > ?
WHERE messages.timestamp > ? AND messages.timestamp < ?
ORDER BY messages.timestamp DESC)
SELECT messages.*
FROM news
@ -87,6 +87,11 @@ class TfTabNewsFeedElement extends LitElement {
[
JSON.stringify(this.following),
this.start_time,
/*
** Don't show messages more than a day into the future to prevent
** messages with far-future timestamps from staying at the top forever.
*/
new Date().valueOf() + 24 * 60 * 60 * 1000,
]);
}
}