-
Notifications
You must be signed in to change notification settings - Fork 19
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
Send read receipts based on timeline scroll position #152
Conversation
PR for #86 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the PR!
One request -- can you follow standard whitespace conventions, like a space after a comma? Without that, it's hard to read the code easily.
I left a few detailed comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some minor cleanup just to improve readability, so take a look at those minor changes to see what sort of code style and whitespace conventions we're looking for. The logic for tracking which events have been read is still needlessly complicated, and also rather inefficient, especially with the repeated population of big hashmaps and subsequent iteration over them.
I still believe that all you really need to do is start a 5-second timeout timer whenever scrolling stops, and then after the timer has reached its timeout deadline, send the read receipts for the last visible event.
That being said, your approach technically works despite being overly complicated, so in the interest of time I'm going to accept and merge it in, and we'll save other improvements for the future.
I left a few comments that mostly target C vs Rust coding styles and inefficiencies scattered throughout.
Please submit another PR to clean things up in the future.
Rework of #124
Closes #86