mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FEATURE: Add last visit indication to topic view page. (#13471)
This PR also removes grey old unread bubble from the topic badges by dropping `TopicUser#highest_seen_post_number`.
This commit is contained in:

committed by
GitHub

parent
0f688f45bd
commit
37b8ce79c9
@ -762,8 +762,8 @@ class ImportScripts::Base
|
||||
puts "", "Updating topic users"
|
||||
|
||||
DB.exec <<~SQL
|
||||
INSERT INTO topic_users (user_id, topic_id, posted, last_read_post_number, highest_seen_post_number, first_visited_at, last_visited_at, total_msecs_viewed)
|
||||
SELECT user_id, topic_id, 't' , MAX(post_number), MAX(post_number), MIN(created_at), MAX(created_at), COUNT(id) * 5000
|
||||
INSERT INTO topic_users (user_id, topic_id, posted, last_read_post_number, first_visited_at, last_visited_at, total_msecs_viewed)
|
||||
SELECT user_id, topic_id, 't' , MAX(post_number), MIN(created_at), MAX(created_at), COUNT(id) * 5000
|
||||
FROM posts
|
||||
WHERE user_id > 0
|
||||
GROUP BY user_id, topic_id
|
||||
|
@ -598,8 +598,7 @@ class ImportScripts::Telligent < ImportScripts::Base
|
||||
# Mark all imported messages as read
|
||||
DB.exec(<<~SQL)
|
||||
UPDATE topic_users tu
|
||||
SET last_read_post_number = t.highest_post_number,
|
||||
highest_seen_post_number = t.highest_post_number
|
||||
SET last_read_post_number = t.highest_post_number
|
||||
FROM topics t
|
||||
JOIN topic_custom_fields tcf ON t.id = tcf.topic_id
|
||||
WHERE tu.topic_id = t.id
|
||||
|
Reference in New Issue
Block a user