Open brigcam opened 3 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum. In any case, thanks for taking an interest in this software and contributing by opening the issue in the first place!
The relevant source is now https://github.com/flarum/sticky/blob/02d8e6822bd02df85eda2252857b0974cfe1393c/src/PinStickiedDiscussionsToTop.php#L50-L50. We should filter out posts made before the global "read all" time.
https://github.com/flarum/core/blob/d82c093c0ff0984f70cfa52a2ea19cbdb5baa6ea/src/User/User.php#L273-L273 is how "all read" is set, so we'd use the marked_all_as_read_at
field.
Bug Report
Current Behavior Sticky topics should remain on top of the "All Discussions" view as long as they're unread. However, clicking on the "Mark All as Read" icon marks them as read, but they remain on top of the view. To un-stick them, one has to open each topic and scroll to its very bottom, only then the topic won't appear anymore on top (after a refresh).
Steps to Reproduce
Expected Behavior The sticky topics shouldn't be on top anymore, but they're still there. The workaround is to open them one by one and scroll them to their bottom.
Screenshots I made a video available here: https://cdn.discordapp.com/attachments/268575717103501312/815763248963780689/2021-03-01_02-48-17.mkv
Environment
Possible Solution I looked into the sticky plugin code, and here https://github.com/flarum/sticky/blob/master/src/Listener/PinStickiedDiscussionsToTop.php
I ran into this line (number 78), which I guess could be the culprit:
->whereColumn('sticky.last_read_post_number', '>=', 'last_post_number');
I guess this should be exchanged for a check of the general "read" status of the topic.
Additional Context None.