Commit Graph

1616 Commits

Author SHA1 Message Date
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
Benjamin Bouvier
a7011d8ac0 ffi: remove lag about timeline reset
We do reset a timeline the first time, to fill the initial items, so
this is a red herring.
2024-07-15 10:21:16 +02:00
Alexis Métaireau
48f11ea025 Enforce the redundant_clone Clippy lint rule.
Fixes #3683
2024-07-11 15:28:33 +02:00
Valere
d9b2b53f83 feat(timeline): Expose shield state for EventTimelineItem (#3679) 2024-07-11 13:18:19 +02:00
Ivan Enderlin
b163368be0 chore: Use futures-util from the workspace. 2024-07-11 11:16:17 +02:00
Ivan Enderlin
5ebfd7bc55 chore: Use tokio from the workspace. 2024-07-11 11:16:17 +02:00
Ivan Enderlin
0d264d209f chore: Use tracing-subscriber from the workspace. 2024-07-11 11:16:17 +02:00
Benjamin Bouvier
2ca6a0e91e ffi: remove ability to set server versions in the ClientBuilder 👿 2024-07-09 12:37:33 +02:00
Benjamin Bouvier
19fcae4e0b sdk: add a way to reset the in-memory and on-disk caches for server capabilities
This required changing the OnceCell to RwLock<Option<>>, because a
OnceCell can't be reset to another value.
2024-07-09 12:37:33 +02:00
Ivan Enderlin
66e02f39ef chore(sdk): Rename RoomInfoUpdate into RoomInfoNotableUpdate.
The patch renames `RoomInfoUpdate` to `RoomInfoNotableUpdate`.
The functions, methods or variables whose names start with
`roominfo_update(.*)`` are renamed `room_info_notable_update$1`.
2024-07-08 18:47:55 +02:00
Johannes Marbach
8e0282ac4a ffi: expose methods for SSO login (#3558)
* ffi: expose methods for SSO login

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>

* Update bindings/matrix-sdk-ffi/Cargo.toml

Co-authored-by: Ivan Enderlin <ivan@mnt.io>
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>

* Refactor code to use a separate object to complete the SSO login

* Remove superfluous .workspace

* Remove superfluous field name

* Fix formatting with nightly toolchain

* Fix clippy errors using nightly toolchain

* Move SSO methods over into Client as AuthenticationService will go away very soon

* Add login tests

* Assign tokio runtime and url getter

* Reformat

* Relocate parts of the code as per review comments

* Add url to debugging representation of SsoHandler

* Add example for login_with_sso_callback

* Use unwrap_or_default to avoid creating empty string

* Remove leftover dependencies

---------

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
Co-authored-by: Ivan Enderlin <ivan@mnt.io>
2024-07-08 14:13:44 +02:00
Benjamin Bouvier
b80c2f7197 timeline: use the previous content's membership info when it's missing from the current membership event
Synapse returns a bare `{ "membership": "leave" }` as the content of a
room membership event (for leave membership changes and likely others).
In this case, it'd still be nice to have some kind of display
name/avatar URL to show in UIs; it's possible to reuse information from
the previous member event, if available.
2024-07-04 17:09:34 +02:00
Jorge Martín
07b6425e10 ffi: Timeline::load_reply_details checks if the event exists locally
Before it would go fetch the event from the server using a network request.
2024-07-04 16:13:35 +02:00
Jorge Martín
ad4d24f7d0 ffi: remove is_encrypted field from RoomInfo
It turns out this will cause a network request if the encryption info hasn't been loaded before, which is the case for opening a client in offline mode. It will slow down displaying the room list or loading the room info in general.
2024-07-04 13:52:27 +02:00
Benjamin Bouvier
6679caecf9 ffi: add doc comments to TracingFileConfiguration and TracingConfiguration 2024-07-03 19:14:44 +02:00
Ivan Enderlin
99e284d8b0 Merge pull request #3585 from Hywan/feat-roomlist-sorting-2
feat(ui): Client-side sorting in `RoomList`
2024-07-03 13:07:00 +02:00