Commit Graph

1583 Commits

Author SHA1 Message Date
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
Ivan Enderlin
606a1510cf feat(ffi) Update RoomList API to the recent changes.
This patch adapts the `RoomList` FFI API to the recent changes to
suport a `Stream<Item = RoomListItem>` instead of a `Stream<Item =
RoomListEntry>`. Behind the scene, it supports client side sorting for
the rooms but this is transparent for this API.

This patch also removes the `RoomListInput` enum as no input is
supporter anymore.

The `entries` method no long returns a `RoomListEntriesResult` but
directly a `TaskHandle`. The given listener will receive the initial
entries as a `VectorDiff::Append`, which first is simpler but also fixe
a potential race condition bug.
2024-07-03 09:20:07 +02:00
Ivan Enderlin
7aa7d1ca53 feat(ui): Remove visible_rooms from RoomListService.
This patch removes the `visible_rooms` sliding sync list from
`RoomListService`. As we are taking the path of doing client-side
sorting, the ordering of the server-side will most likely always
mismatch the ordering of the client-side, thus using `visible_rooms`
with room indices make no sense (indices from server-side won't map
indices on the client-side, so room ranges from client-side won't map
what the server knows).

We used to use `visible_rooms` to “preload” the timeline of rooms in
the user app viewport, with a `timeline_limit` of 20. This should be
replaced by room subscriptions starting from now. For the moment, the
user of `RoomListService` is responsible to do that manually. Maybe
`RoomListService` will handle that automatically in the future.
2024-07-03 09:17:28 +02:00
Benjamin Bouvier
a1b557b20a ffi(client builder): reduce indent in build_with_qr_code using a let else statement
No functional changes.
2024-07-02 14:05:09 +02:00
Benjamin Bouvier
b8fc5f4764 ffi(client builder): inline build_inner into its one caller
No functional changes.
2024-07-02 14:05:09 +02:00
Benjamin Bouvier
d531a7cc01 ffi(client builder): inline enable_cross_process_refresh_lock_inner into its one caller
No functional changes.
2024-07-02 14:05:09 +02:00
Benjamin Bouvier
84a57ce690 ffi(client builder): remove unused inner field from the builder 2024-07-02 14:05:09 +02:00
Kévin Commaille
a7e4849f25 sdk: Use strongly-typed strings where it makes sense
Where a string is clearly documented as a room ID, event ID or mxc URI,
use OwnedRoomId, OwnedEventId and OwnedMxcURI, respectively.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-07-01 12:55:15 +02:00
Stefan Ceriu
38a18c3c8e feat(ffi): add Element specific well known struct and a way to deserialize it from external clients 2024-06-28 16:58:55 +02:00
Stefan Ceriu
70fddc0e1b feat(ffi): expose method for reading the server name part of the current user's identifier. 2024-06-28 16:58:55 +02:00
Stefan Ceriu
84796ab32a feat(ffi): expose method for sending generic GET requests through the SDK's inner HTTP client. 2024-06-28 16:58:55 +02:00
Andy Balaam
6464d21813 crypto: Storage changes for keeping sender data with InboundGroupSessions (#3556)
Signed-off-by: Andy Balaam <mail@artificialworlds.net>
Co-authored-by: Damir Jelić <poljar@termina.org.uk>
2024-06-28 14:14:55 +02:00
Benjamin Bouvier
1c92633a23 ffi: add new error conversions into ClientError
*sigh*
2024-06-27 18:53:00 +02:00
Benjamin Bouvier
c3cdc4526e ffi: rename Timeline::edit to Timeline::edit_by_event_id, and introduce a more general Timeline::edit 2024-06-27 18:53:00 +02:00
Benjamin Bouvier
394effbc72 send queue: rename AbortSendHandle to SendHandle 2024-06-27 18:53:00 +02:00
Hubert Chathi
d41af396cc Embed device keys in Olm-encrypted messages (#3517)
This patch implements MSC4147[1].

Signed-off-by: Hubert Chathi <hubertc@matrix.org>

[1]: https://github.com/matrix-org/matrix-spec-proposals/pull/4147
2024-06-27 12:18:52 +02:00
Benjamin Bouvier
7f0b035e86 ffi: respawn send queue tasks just before subscribing to the client-wide send q errors 2024-06-26 19:42:14 +02:00
Kévin Commaille
eaf7a9e350 chore: rustfmt fixes
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-06-26 14:10:36 +02:00
Kévin Commaille
0cc7103fd9 docs: Fix indentation of list items paragraphs
Thanks to the new doc_lazy_continuation clippy lint in nightly.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-06-26 14:10:36 +02:00
Damir Jelić
3be84a5a30 refactor(sdk-crypto): Room key sharing, introduce extensible strategy
This patch set does two things:

1. Extracted the logic to collect the devices that should receive a room key.
2. Introduce a new CollectStrategy enum which defines which rules are
   used to collect recipient devices for a room key. Currently only the
   existing rules have beenmoved under this enum.
2024-06-25 16:54:25 +02:00
Jorge Martín
0162f6ba49 Add doc clarification for ffi::room_list_item.is_encrypted() 2024-06-25 12:42:59 +02:00
Valere
d6e523c1d1 refactor(sdk-crypto) - RoomKey Sharing | add settings for strategy 2024-06-25 11:16:24 +02:00
Jorge Martín
912e75c1f8 ffi: add RoomListItem::is_encrypted() function. 2024-06-24 16:01:19 +02:00
Jorge Martín
004941b6b4 ffi: add encryption info to RoomInfo 2024-06-24 16:00:29 +02:00
Benjamin Bouvier
90f73195b1 send queue: introduce fallible fake state store in the send queue code 2024-06-24 13:56:10 +02:00
Doug
e89659b69d ffi: Tidy up authentication.rs file.
(Nothing changed, just moving things around)
2024-06-24 10:56:04 +02:00
Doug
6d728be32d ffi: Split up AuthenticationError between ClientBuildError and a new OidcError. 2024-06-24 10:56:04 +02:00
Doug
5cbc803347 ffi: Refactor authentication_service.rs to authentication.rs 2024-06-24 10:56:04 +02:00
Doug
2d479e0177 ffi: Remove the AuthenticationService 2024-06-24 10:56:04 +02:00
Kévin Commaille
730c287201 chore: Fix new clippy nightly lints
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-06-23 20:20:09 +02:00
Andy Balaam
2b1bddb2f0 Merge pull request #3587 from matrix-org/doug/client-oidc-helpers
sdk: Move the OIDC helper methods from the FFI's `AuthenticationService` into `Client`
2024-06-21 10:14:35 +01:00
Doug
837cfaed48 sdk: Clarify InvalidState OIDC check and prepare abort method for the FFI. 2024-06-20 15:54:06 +01:00
Doug
655ced2c81 docs: Clarify some of the OIDC helper methods more. 2024-06-20 15:54:06 +01:00
Doug
748f40c250 sdk: Add ClientBuilder::requires_sliding_sync method. 2024-06-20 14:27:55 +02:00