-
Notifications
You must be signed in to change notification settings - Fork 92
Setting to Mark as Read when Sending a Message #956
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
base: main
Are you sure you want to change the base?
Conversation
Looks great, and make sense to have it on by default. Perhaps @tarkah can go through it as it touches a lot he is used to look at. |
Realized I missed one case where |
dfb8ab7
to
c884728
Compare
c884728
to
2830d28
Compare
2830d28
to
d0ffc41
Compare
src/buffer/input_view.rs
Outdated
record_message_tasks | ||
.into_iter() | ||
.map(Task::future), | ||
.map(Task::future) | ||
.chain( | ||
update_read_marker_tasks | ||
.into_iter() | ||
.map(Task::future), | ||
), |
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.
Why not chain these when returning from the original function if they don't need to be handled separately?
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 originally tried to return a single Vec
, but I couldn't get the compiler to accept the two Future
s in the same Vec
(and some of what I looked up trying to get it to work said it's impossible). I had assumed these iterators could be chained because they're mapped into Task::future
, but Task
isn't available in iced_core
as far as I could tell. Wasn't sure we wanted to introduce iced
as a dependency for data
, so I went with this.
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.
Don't know why I listened to those that said impossible, after thinking on a bit I realized there are a couple ways to do it at least. Went with boxing as that seemed like the simplest way.
Adds an option to mark a buffer as read when sending a message. Required a bit more plumbing than I was hoping for, but seems to work in my testing.