api(rust and jsonrpc): marknoticed_all_chats method to mark all chats as notices, including muted ones. (#7709)

made for solving

https://github.com/deltachat/deltachat-desktop/issues/5891#issuecomment-3687566470

will also be more efficient, because desktop currently loads all fresh
messages to find out which chats to mark as noticed.
76d32bfc93/packages/frontend/src/components/AccountListSidebar/AccountItem.tsx (L334)


# progress
- [x] implementation
- [x] write a test
- [x] make a pr to use it in desktop
https://github.com/deltachat/deltachat-desktop/pull/5923
- [x] address review comments

---------

Co-authored-by: WofWca <wofwca@protonmail.com>
This commit is contained in:
Simon Laux
2026-01-20 08:52:59 +00:00
committed by GitHub
parent f5e1e2678b
commit 4ccd3cb665
5 changed files with 148 additions and 4 deletions

View File

@@ -1492,6 +1492,15 @@ impl EventTracker {
pub fn clear_events(&self) {
while let Ok(_ev) = self.try_recv() {}
}
/// Takes all items from event queue and returns them.
pub fn take_events(&self) -> Vec<Event> {
let mut events = Vec::new();
while let Ok(event) = self.try_recv() {
events.push(event);
}
events
}
}
/// Gets a specific message from a chat and asserts that the chat has a specific length.