-
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
api!: Remove msg_id (last message ID) from Chatlist::get_summary2() (#…
…3071) `Chatlist::get_summary2()` is used in the jsonrpc API. CFFI uses `Chatlist::get_summary()` which logic is preserved (it uses message ids cached in the `Chatlist`). The motivation for this change is that jsonrpc API uses `get_last_message_for_chat()` returning the message id + `Chatlist::get_summary2()` taking the message id when building a chatlist, but if the message is ephemeral, the id can expire and building the chatlist would fail. The solution is to return a summary for the last message (if any) in the chat from `Chatlist::get_summary2()` so the call to `get_last_message_for_chat()` goes away (and two SQL queries are just merged into one) and overall the API is easier to use. Also this change extends `struct Summary` with the message viewtype (so an extra call to `Message::load_from_db()` goes away) and the message id in case if it's needed for any purposes beyond building the chatlist.
- Loading branch information
Showing
9 changed files
with
224 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.