Commit Graph

8808 Commits

Author SHA1 Message Date
Benjamin Bouvier
5df53d7338 timeline queue refactoring: address review comments 2024-05-20 11:18:43 +02:00
Benjamin Bouvier
9575ee92d4 timeline queue: unify updating event send state into a single place 2024-05-20 11:18:43 +02:00
Benjamin Bouvier
e49d62988b timeline queue: tiny refactorings
A few renamings here and there, making use of `as_variant!` a bit more,
adding a few comments,…
2024-05-20 11:18:43 +02:00
Benjamin Bouvier
8867a03c07 memory state store: correctly save user avatar url
With a regression test.

Fixes #3432.
2024-05-20 11:03:07 +02:00
Kévin Commaille
6c18bcf748 sdk: Improvements around generate_image_thumbnail (#3415)
* sdk: Return a Thumbnail from generate_image_thumbnail

We have already all the data for it.
Also fixes an error where the thumbnail format was assumed to always be
JPEG.

* sdk: Allow to select the format of the generated thumbnail

Sending an attachment could often fail if the image crate
cannot encode the thumbnail to the same format as the original.
This allows to select a known supported format to always
be able to generate a thumbnail.

* sdk: Do not return error of thumbnail generation for SendAttachment

Since the thumbnail is optional, failing to generate it should not
stop us from sending the attachment.

* Apply code review fixes
* sdk: Split attachment tests in separate file
* sdk: Add integration tests for generating thumbnails
* Revert wiremock debug log level

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-05-17 16:48:59 +02:00
Benjamin Bouvier
4cc67e9002 room list/notification services: don't request the room avatar since it's always provided
It's always provided in the `avatar` response in the field, which
sliding sync's using by default, so there's no need to request the
`m.room.avatar` event too.
2024-05-17 15:14:47 +02:00
Benjamin Bouvier
bac0654a63 sliding sync: don't store the server-computed name in place of the raw name event
If we want to be able to note the absence of a room name, we shouldn't
take the name returned by the server (which may be computed, and thus
always be non-null). This way, we can expose both the name contained in
the m.room.name event as well as the computed name everywhere.

A consequence of this is that the room list service must now ask for the
m.room.name event as part of the required state for every room.
2024-05-17 15:14:47 +02:00
Valere
6111beded7 ffi: Expose ed25519/curve25519 keys in bindings (#3420) 2024-05-17 13:55:18 +02:00
Benjamin Bouvier
b0558a002b day divider: don't recall a previous item if it's scheduled for deletion
With a regression test that didn't pass on main, and would incorrectly
remove the read marker, because it tried to replace the day divider at
(4), that was just scheduled for deletion in the previous loop
iteration.
2024-05-17 11:59:40 +02:00
Benjamin Bouvier
c6f4ca09f5 day divider: simplify control flow in handle_event 2024-05-17 11:59:40 +02:00
Benjamin Bouvier
532f3a3ee8 day divider: add new invariant, a read marker should not disappear 2024-05-17 11:59:40 +02:00
Jorge Martín
3914e31461 ffi: Add the user's display name to RoomMembership timeline content
This is useful to properly format membership state events.
2024-05-17 10:45:48 +02:00
Damir Jelić
a48d604b3f chore: Downgrade prost-derive, since the latest version was yanked 2024-05-17 10:40:31 +02:00
Benjamin Bouvier
e486da4b08 cross-process lock: add a log line when aborting the previous renew task 2024-05-16 17:16:15 +02:00
Benjamin Bouvier
7ae0bcecfd room preview: rejigger public API to pass a RoomOrAliasId in place of a RoomId to get_room_preview 2024-05-16 10:58:41 +02:00
Benjamin Bouvier
1fd29f7b6d room preview: allow passing through a list of servers to discover a room with MSC3266
Fixes #3395.`
2024-05-16 10:58:41 +02:00
Benjamin Bouvier
c8f6fe4f6d event cache/timeline: reuse the Paginator when running back-paginations (#3373)
* event cache: reuse the paginator internally

Fixes #3355.

* event cache: move the `pagination_token_notifier` into the `RoomPaginationData` as well

* event cache: introduce a `RoomPagination` API object and move code around

Only code motion. No changes in functionality.

* event cache: remove "paginate" (et al.) in `RoomPagination` method names

No changes in functionality, just renamings.

* event_cache/timeline: have the event cache handle restarting a back-pagination that failed under our feet

When a timeline reset happens while we're back-paginating, the event
cache method to run back pagination would return an success result
indicating that the pagination token disappeared. After thinking about
it, it's not the best API in the world; ideally, the backpagination
mechanism would restart automatically.

Now, this was handled in the timeline before, and the reason it was
handled there was because it was possible to back-paginate and ask for a
certain number of events. I've removed that feature, so that
back-pagination on a live timeline matches the capabilities of a
focused-timeline back-pagination: one can only ask for a given number of
*events*, not timeline items.

As a matter of fact, this simplifies the code a lot by removing many
data structures, that were also exposed (and unused, since recent
changes) in the FFI layer.

* Address review comments
2024-05-16 10:22:05 +02:00
Damir Jelić
21804ab313 chore(crypto): Add a missing changelog entry 2024-05-16 09:33:12 +02:00
Ivan Enderlin
14252807a2 Merge pull request #3418 from zecakeh/attachment-mentions
sdk: Allow to send mentions with attachments
2024-05-16 09:06:01 +02:00
Kévin Commaille
e50b574f12 sdk: Allow to send mentions with attachments
Particularly useful for captions

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-05-15 16:40:06 +02:00
Damir Jelić
35173347fd chore: Bump the vodozemac version
This gives us the necessary primitives for the QR code login feature.
2024-05-15 15:01:53 +02:00
Ivan Enderlin
64c5a83e33 Merge pull request #3413 from zecakeh/send-attachment-path
ui: Take a `PathBuf` to send an attachment
2024-05-15 13:24:09 +02:00
Kévin Commaille
8da3922ff0 sdk: Rename SendAttachment's url field to filename
It is name filename before and after, and it is not a url.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-05-15 13:00:49 +02:00
Kévin Commaille
eba5efc829 Merge branch 'main' into send-attachment-path
Signed-off-by: Kévin Commaille <76261501+zecakeh@users.noreply.github.com>
2024-05-15 10:57:08 +02:00
Ivan Enderlin
7ed6db9758 Merge pull request #3406 from zecakeh/edit-without-relation
ui: Make Timeline::edit take a RoomMessageEventContentWithoutRelation
2024-05-15 10:55:21 +02:00
Kévin Commaille
32c7a1ab78 ui: Take a PathBuf to send an attachment
I found the previous API confusing. Firstly, the parameter name was "filename" when we want a file path.
Secondly, we take a `String` when we want a `Path`.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-05-15 10:50:26 +02:00
Damir Jelić
cbb92cacce feat(crypto): Add support to import/export the newly added secrets bundle 2024-05-14 11:46:56 +02:00
Damir Jelić
402d620608 feat(crypto): Add a SecretsBundle type 2024-05-14 11:46:56 +02:00
Doug
b57dbd8d1a xtask: Allow passing multiple targets to Swift's build-framework.
* Fix CI
2024-05-14 11:33:13 +02:00
Damir Jelić
aa6bbc1a0f feat(crypto): Add data types to parse QR codes from MSC4108 2024-05-14 10:47:22 +02:00
Damir Jelić
6672302684 chore: Make the url crate a workspace dependency 2024-05-14 10:47:22 +02:00
Kévin Commaille
9e4125bb39 ui: Make Timeline::edit take a RoomMessageEventContentWithoutRelation
Like send_reply.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-05-13 20:25:44 +02:00
Kévin Commaille
cb452802bb chore: Upgrade ruma
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-05-13 20:25:43 +02:00
Benjamin Bouvier
da249bbc51 crypto: remove the fake crypto store test for olm session wedging
Two reviewers were suspicious the test wasn't very useful, so I propose
to hereby remove it.
2024-05-13 18:30:25 +02:00
Benjamin Bouvier
c16bfd3234 timeline: reuse internal id when adding pending replied-to details to an item
Fixes #3379.
2024-05-13 18:29:34 +02:00
Benjamin Bouvier
83427b325c ci: use the latest synapse-service image with msc3266
And re-enable the room preview test there.
2024-05-13 18:11:07 +02:00
Andy Balaam
b99e103704 Merge pull request #3409 from matrix-org/andybalaam/disable-flaking-nse-test
Ignore a flaking test
2024-05-13 16:55:17 +01:00
Andy Balaam
6d6f470e11 Ignore a flaking test 2024-05-13 16:42:22 +01:00
Benjamin Bouvier
94d3758a0d base: sort the heroes in the computed display name alphabetically 2024-05-13 15:11:57 +02:00
Andy Balaam
4b1d03f229 Merge pull request #3343 from matrix-org/andybalaam/test-store-cache-drop
crypto: Add a standalone integration test for the NSE race
2024-05-13 14:09:40 +01:00
Andy Balaam
06825c6385 crypto: Test for the NSE race bug #3110
Adds a test for https://github.com/matrix-org/matrix-rust-sdk/issues/3110
that fails before the fix and passes afterwards.
2024-05-13 13:55:04 +01:00
Ivan Enderlin
2987bd1f6d chore(cargo) Update dependencies
chore(cargo) Update dependencies
2024-05-13 14:32:05 +02:00
Ivan Enderlin
099cd8d6a0 chore(sdk): Remove the need for cfg_vis.
It introduces more dependencies for —apparently— no useful need here.
2024-05-13 14:17:45 +02:00
Ivan Enderlin
f669b3a530 chore(test): Use workspace dependencies. 2024-05-13 14:16:36 +02:00
Ivan Enderlin
da8588787f chore(cargo): Declare reqwest as a workspace dependency. 2024-05-13 14:15:35 +02:00
Ivan Enderlin
e21e412aae chore(cargo): Update dependencies. 2024-05-13 14:12:32 +02:00
Andy Balaam
749ed2c3e0 crypto: Allow duplicating a Client in tests 2024-05-13 12:17:11 +01:00
Benjamin Bouvier
e709cca2f5 test utils: prefer From impl to Into impl
Thanks clippy, i guess?
2024-05-13 12:36:44 +02:00
Benjamin Bouvier
f661b0d728 event cache: add a regression test for ignoring/unignoring at the event cache level 2024-05-13 12:36:44 +02:00
Benjamin Bouvier
cef4409dda timeline: make use of the EventFactory in more tests 2024-05-13 12:36:44 +02:00