-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: Compute snooze state in thread #2218
base: master
Are you sure you want to change the base?
Conversation
|
Snoozed(apiValue = "snoozed"), | ||
Unsnoozed(apiValue = "unsnoozed"), | ||
WasSnoozed(apiValue = "was_snoozed"), |
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.
Maybe add some short comment explaining what each state represents exactly.
} | ||
|
||
private fun updateThread() { | ||
|
||
fun Thread.updateSnoozeSatesBasedOn(message: Message) { |
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.
fun Thread.updateSnoozeSatesBasedOn(message: Message) { | |
fun Thread.updateSnoozeStateBasedOn(message: Message) { |
duplicates.forEach { duplicate -> | ||
updateSnoozeSatesBasedOn(duplicate) | ||
} |
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.
duplicates.forEach { duplicate -> | |
updateSnoozeSatesBasedOn(duplicate) | |
} | |
duplicates.forEach(::updateSnoozeSatesBasedOn) |
duplicates.forEach { duplicate -> | ||
updateSnoozeSatesBasedOn(duplicate) | ||
} |
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.
Do we really need/want to update the Thread based on the duplicated Messages ? 🤔
This PR simply computes the snooze state at the thread level and can directly be merged inside master as it's not even visible to the user