jsonrpc: Remove message id from chatlist item (#3071)

Why? because desktop currently fetches the chatlist multiple times, even though it just needs the
chatlistitem for one chat.

Note: @r10s was worried before that exposing the method to get a single updated chatlistitem could
lead to race conditions where the chatlist item is newer than the chatlist order. But I don't think
this will change anything for desktop besides making it a little faster (because currently desktop
fetches the whole chatlist instead of just the entry it needs when an entry updates).
This commit is contained in:
Simon Laux
2023-01-07 02:00:48 +01:00
committed by iequidoo
parent edfdbbdc90
commit ea8ee4e67d
6 changed files with 43 additions and 29 deletions

View File

@@ -177,7 +177,7 @@ class Account:
entries = await self._rpc.get_chatlist_entries(self.id, flags, query, contact and contact.id)
if not snapshot:
return [Chat(self, entry[0]) for entry in entries]
return [Chat(self, entry) for entry in entries]
items = await self._rpc.get_chatlist_items_by_entries(self.id, entries)
chats = []