Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Publish read topic tracking events for private messages. #14274

Merged
merged 1 commit into from Sep 9, 2021

Conversation

tgxworld
Copy link
Contributor

@tgxworld tgxworld commented Sep 8, 2021

Follow-up to fc1fd1b

@@ -296,8 +298,6 @@ def track_visit!(topic_id, user_id)
FROM topic_users AS ftu
WHERE ftu.user_id = :user_id and ftu.topic_id = :topic_id)"

INSERT_TOPIC_USER_SQL_STAFF = INSERT_TOPIC_USER_SQL.gsub("highest_post_number", "highest_staff_post_number")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer required because the SQL query doesn't include highest_post_number anymore.

topic_users.notification_level, tu.notification_level old_level, tu.last_read_post_number
"

UPDATE_TOPIC_USER_SQL_STAFF = UPDATE_TOPIC_USER_SQL.gsub("highest_post_number", "highest_staff_post_number")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer required because the SQL query doesn't include highest_post_number anymore.

@@ -312,26 +312,22 @@ def update_last_read(user, topic_id, post_number, new_posts_read, msecs, opts =
threshold: SiteSetting.default_other_auto_track_topics_after_msecs
}

# 86400000 = 1 day
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea what this comment is referring to.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is because there is an msecs argument for this function and there was a bigger comment closer to the top:

f0e942f#diff-94a17ebd5fec7b95f6eb1bb1576a8e15c52f992367c56e94640a8834b31615a9R168-R188

But yeah not really necessary

Copy link
Contributor

@martin-brennan martin-brennan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good just a few clarifications.

@@ -312,26 +312,22 @@ def update_last_read(user, topic_id, post_number, new_posts_read, msecs, opts =
threshold: SiteSetting.default_other_auto_track_topics_after_msecs
}

# 86400000 = 1 day
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is because there is an msecs argument for this function and there was a bigger comment closer to the top:

f0e942f#diff-94a17ebd5fec7b95f6eb1bb1576a8e15c52f992367c56e94640a8834b31615a9R168-R188

But yeah not really necessary

app/models/topic_user.rb Show resolved Hide resolved
@tgxworld
Copy link
Contributor Author

tgxworld commented Sep 9, 2021

Thank you for the review @martin-brennan and @lis2 🤗

@tgxworld tgxworld merged commit 412587f into discourse:main Sep 9, 2021
@tgxworld tgxworld deleted the publish_read_pm branch September 9, 2021 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants