Commit Graph

2231 Commits

Author SHA1 Message Date
Ivan Enderlin
067b1e0020 feat(ffi): Add Client::available_sliding_sync_versions.
This patch adds bindings to `Client::available_sliding_sync_versions`
to `matrix-sdk-ffi`.

This patch also moves `Client::sliding_sync_version` from “private” to
“public” FFI API, in thee sense that this method is now exported with
UniFFI.
2024-08-27 17:25:12 +02:00
Ivan Enderlin
e1f623cf56 feat: Use the new sliding_sync::VersionBuilder. 2024-08-27 17:25:12 +02:00
Ivan Enderlin
de8537f8b0 feat: Use sliding_sync::Version everywhere.
This patch replaces all the API using simplified sliding sync, or
sliding sync proxy, by a unified `sliding_sync::Version` type!

This patch disables auto-discovery for the moment. It will be re-enable
with the next patches.
2024-08-27 17:25:12 +02:00
Daniel Salinas
b908fa78b9 The length param from Truncate was not being exposed 2024-08-27 15:17:37 +02:00
Daniel Salinas
47671a182d Expose login with email + password on the client 2024-08-26 18:23:25 +02:00
Doug
c769e32b41 ffi: Expose the new cache store path to the bindings. 2024-08-23 15:15:03 +02:00
Richard van der Hoff
e88f14a1f9 ffi: expose new SessionRecipientCollectionErrors to application
Fixes https://github.com/matrix-org/matrix-rust-sdk/issues/3842
2024-08-22 12:47:16 +01:00
Stefan Ceriu
4cc5790c64 ffi: expose room membership through the RoomListItem and allow invited rooms to be build differently than "full" ones (#3869)
We're finding ourselves in the situation in which we can't interact with
invites through normal Room APIs as `full_room`s can't be build from the
RoomListItem. Full rooms require the timeline to be configured before
use and the timeline can't be configured because encryption cannot be
fetched for invited rooms on homeservers that have previews disabled
(see #3848 and #3850)

In response we now expose the room's membership directly from the
`RoomListItem` so that the final client can chose which of the 2 rooms
types (invited or full) to ask for before using aforementioned APIs.

Powers https://github.com/element-hq/element-x-ios/pull/3189
2024-08-21 16:55:03 +03:00
Jorge Martín
fbc9db9b15 ffi: add info to FFI room redaction event 2024-08-21 13:29:36 +02:00
Richard van der Hoff
a27ebaabae ffi: add ClientBuilder::room_key_recipient_strategy
... and pass it through to the underlying ClientBuilder.
2024-08-20 18:22:56 +01:00
Ivan Enderlin
ed19bf7bc5 fix(ffi): New fields formatter to remove duplicated span fields.
This patch fixes a bug in the tracing system. It introduces one
fields formatter _per layer_ to force the fields to be recorded in
different span extensions, and thus to remove the duplicated fields in
`FormattedFields`.

The patch contains links to the bug report in `tokio-rs/tracing`. This
patch is a workaround.
2024-08-19 14:44:04 +02:00
Ivan Enderlin
eeb325abb7 chore(ffi): Format code. 2024-08-19 14:44:04 +02:00
Richard van der Hoff
cd0d79dd88 crypto: Key sharing option to error for verification violation 2024-08-19 13:13:58 +01:00
Richard van der Hoff
b497577717 crypto: use UserIdentities utility functions
... instead of lots of `match` and `own()` and `other()`.
2024-08-16 16:58:27 +01:00
Ivan Enderlin
102da7cb9a feat(ffi): Add RoomInfo::cached_user_defined_notification_mode.
This patch replaces `RoomInfo::user_defined_notification_mode` by
its cached variant: `cached_user_defined_notification_mode`, and
call `Room::cached_user_defined_notification_mode` which will boost
performance when computing a new `RoomInfo`.
2024-08-15 14:51:16 +03:00
Richard van der Hoff
f66c74e878 crypto: extend CollectionStrategy::DeviceBasedStrategy
Add (as yet unimplemented) `error_on_verified_user_problem` option
2024-08-14 14:57:42 +01:00
Richard van der Hoff
dadc85c4fc crypto: remove CollectStrategy::new_device_based
The list of boolean arguments is confusing. We may as well just construct the
`DeviceBasedStrategy` directly.
2024-08-14 14:57:42 +01:00
Benjamin Bouvier
766786e2f1 pinned events(refactor): get rid of the PinnedEventCache
This commit makes use of the `RoomEventCache` instead of the
`PinnedEventCache` for a room, so the latter can be removed.
2024-08-13 17:17:16 +02:00
Benjamin Bouvier
a0c8b71236 refactor(sdk): merge Room::event and Room::event_with_config
It's better to have fewer public APIs, especially when there's little
annoyance to have it. We could use a request builder that converts into
a Future, too, but considering there's only a single optional parameter,
it's fine to include it in the function's signature.
2024-08-12 11:51:54 +02:00
Ivan Enderlin
be404f6666 feat(sdk): Subscribe to many rooms only via Sliding Sync.
This patch changes the `SlidingSync::subscribe_to_room` method to
`subscribe_to_rooms`. Note the plural form. It's now mandatory to
subscribe to a set of rooms. The idea is to avoid calling this method
repeatedly. Why? Because each time the method is called, it sends a
`SlidingSyncInternalMessage` of kind `SyncLoopSkipOverCurrentIteration`,
i.e. it cancels the in-flight sliding sync request, to start over with
a new one (with the new room subscription). A problem arises when the
async runtime (here, Tokio) is busy: in this case, the internal message
channel can be filled pretty easily because its size is 8. Messages
are not consumed as fast as they are inserted. By changing this API:
subscribing to multiple rooms will result in a single internal message,
instead of one per room.

Consequently, the rest of the patch moves the `subscribe` method of
`room_list_service::Room` to `room_list_service::RoomListService`
because it now concerns multiple rooms instead of a single one.
2024-08-09 11:58:59 +03:00
Stefan Ceriu
89ce8870a9 ffi: provide manual cancellation mechanism for identity/cross-signing reset handles
- works around swift issue where nil-ing the handle is not enough for it to get cancelled
2024-08-09 10:27:56 +03:00
Ivan Enderlin
70f46d48af chore(ffi): More idiomatic format!. 2024-08-08 17:54:49 +02:00
Timo
58f4e2b1ad FFI Element Call: Fix the permission list returned by the get_element_call_required_permissions ffi function. 2024-08-08 17:54:49 +02:00
Jorge Martín
57963dcf36 ffi: add method for the ClientBuilder to provide a RequestConfig for the client 2024-08-07 11:48:34 +02:00
Damir Jelić
96b615ba8e Remove Olm Session cache from the individual crypto store implementations 2024-08-06 15:10:13 +02:00
Jorge Martín
c83fa3a532 sdk-ui: move conversion between Content::RoomPinnedEvents from ffi to sdk-ui 2024-08-06 10:37:18 +02:00
Jorge Martín
d509d79472 ffi: add RoomPinnedEventsChange and a diffing step to know what happened in the last pinning/unpinning events action 2024-08-06 10:37:18 +02:00
Jorge Martín
9f7f1a98fb ffi: base the ffi::Room::clear_pinned_events method in sdk::Room::clear_pinned_events 2024-08-05 14:31:03 +02:00
Doug
4c220ed030 shields: Put the Code inside the Colour instead of the Colour inside the Code. 2024-08-05 10:48:06 +02:00
Doug
037badf7a4 chore: Strongly typed ShieldStates. 2024-08-05 10:48:06 +02:00
Jorge Martín
4de1375a76 ffi: add bindings for Room::clear_pinned_events_cache 2024-08-02 18:54:28 +02:00
Jorge Martín
769a627496 ci: try fixing the kotlin bindings tests by using NDK 27 2024-08-02 17:28:36 +02:00
Timo
7614bfb716 WidgetDriver: Introduce new capabilities for sending and updating delayed events.
Those capabilities are also exposed to the FFI.
+ related tests
2024-08-02 15:14:09 +01:00
Jorge Martín
1ca4377baf ffi: add FFI bindings for creating the new pinned events focused timeline 2024-08-02 13:11:24 +02:00
Stefan Ceriu
8fe2b37354 ffi: Expose identity reset mechanism 2024-07-29 16:52:03 +03:00
Jorge Martín
6fca1e81ed ffi: expose pin_event and unpin_event, also the currently pinned event ids in RoomInfo 2024-07-26 14:20:53 +01:00
Jorge Martín
95637c57da ffi: expose Room::can_user_pin_unpin check 2024-07-26 14:20:53 +01:00
Benjamin Bouvier
f0015bb10d timeline: store reaction by key by sender, instead of by key by local or remote id
This makes it impossible to represent states like "there's a local *and*
a remote echo for the same sender for a given reaction", or multiple
reactions from the same sender to the same event, and so on.
2024-07-25 15:13:23 +02:00
Benjamin Bouvier
3d40a5c30c ffi: remove the Reaction::count field
It's exactly the same as `Reaction::senders`'s length.
2024-07-25 15:13:23 +02:00
Doug
56e3780808 ffi: Use the SDK's (tested) logic for overriding the sliding sync proxy. 2024-07-23 11:34:49 +02:00
Benjamin Bouvier
30c401ac75 timeline: rename item_by_transaction_id to local_item_by_transaction_id 2024-07-22 11:32:09 +02:00
Doug
4bbb6bd60c ffi: Don't add a custom SS proxy in ClientBuilder when using SSS. 2024-07-18 09:48:53 +02:00
Doug
e37f65c46b ffi: Allow restoring an existing session with SSS enabled. 2024-07-18 09:48:53 +02:00
Doug
92b4c2a469 ffi: Expose client builder method to disable built in CAs. 2024-07-18 09:10:42 +02:00
Ivan Enderlin
ea2a27075a feat(ffi,base,ui,sdk): Migrate from sliding sync to simplified sliding sync.
This patch migrates the entire SDK to sliding sync to simplified sliding
sync.
2024-07-17 16:33:37 +02:00
Ivan Enderlin
ea9f79a006 feat(sdk): Remove SlidingSync::unsubscribe_from_room.
Simplified sliding sync no longer has the concept of unsubscribing from
a room. This patch removes this API.
2024-07-17 16:33:37 +02:00
Ivan Enderlin
e3b950a9f0 feat(client): Add the Client::is_simplified_sliding_sync_enabled field.
This patch is the first over two patches to change the support
of Simplified MSC3575 from a compiler feature flag to a runtime
configuration. This configuration is held by the `Client`.
By default, it's turned off inside `matrix-sdk-ffi` and
`matrix-sdk-integration-testing`, otherwise it's turned on.
2024-07-17 16:33:37 +02:00
Kévin Commaille
1cc8292034 sdk: Allow to request animated thumbnails (#3710)
New feature from Matrix 1.11.

- [x] Public API changes documented in changelogs (optional)

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-07-17 10:18:53 +00:00
Timo
5dbd5f1adf element call(ffi): add widget permissions for room create and call member state keys with device id (#3706)
It is possible to remove the m.call capability because we now have
merged and released a version that does not request it anymore on
call.element.io

---------

Signed-off-by: Benjamin Bouvier <public@benj.me>
Co-authored-by: Benjamin Bouvier <public@benj.me>
2024-07-16 11:38:48 +00:00
Benjamin Bouvier
7b4f480b2a timeline: use Room::make_edit_event instead of doing adhoc edition 2024-07-15 13:49:23 +02:00