WIP: api!: add LIMIT arg to get_chat_media

In Delta Chat desktop we show the 3 recently used WebXDC apps,
which relies on `get_chat_media`, which is quite expensive.
Hopefully adding `LIMIT 3` makes it faster.

Marking this as a breaking change
because it's breaking TypeScript-wise,
but shouldn't be breaking behavior-wise,
because not providing the argument in JSON-RPC
should be equivalent to providing `null`
(which gets converted to `None`).

TODO:
- [ ] Add to CFFI?
- [ ] Docs. Both the core fn and the JSON-RPC.
This commit is contained in:
WofWca
2025-10-20 19:05:52 +04:00
parent fc81cef113
commit 781de46e26
5 changed files with 64 additions and 5 deletions

View File

@@ -1016,6 +1016,7 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
Viewtype::Image,
Viewtype::Gif,
Viewtype::Video,
None,
)
.await?;
println!("{} images or videos: ", images.len());