Commit Graph

2143 Commits

Author SHA1 Message Date
Ivan Enderlin
0f9faad48a doc(ffi,ui): Update the CHANGELOG.mds. 2025-07-09 12:31:22 +02:00
Ivan Enderlin
d7550ec645 feat(ui): RoomListService::subscribe_to_rooms calls LatestEvents::listen_to_room.
This patch updates `RoomListService::subscribe_to_rooms` to call
`LatestEvents::listen_to_room` automatically. This method becomes async,
which propagates to a couple of callers.

The idea is that when one is interested by a specific room, a
subscription will be applied. This is an opportunity to also “activate”
the computation of the `LatestEvent` for this specific room, so that the
user doesn't have to do that manually (except if room subscription is
never used).
2025-07-09 12:31:22 +02:00
Benjamin Bouvier
a50a570fc1 doc(ffi): update an oudated method doc comment 2025-07-07 16:18:45 +02:00
Benjamin Bouvier
6a1576a085 refactor(timeline): make use of the threaded event cache in the timeline 2025-07-07 11:40:18 +02:00
Jonas Platte
07808b4301 refactor: Enable extra code style clippy lints 2025-07-05 21:20:34 +02:00
Stefan Ceriu
b44a1e46c4 feat(base): ignore threaded messages when computing room read receipts and client wide threads feature flag
With the UI crate now sending threaded read receipts we need to start considering them when computing unread counts. As a first step before the participation model, threaded messages will be ignored when computing room unread counts.
2025-07-04 11:42:35 +03:00
Stefan Ceriu
f17c3c5af4 feat(ui): send (un)threaded read receipts based on the current timeline instance's focus kind.
This patch moves away from always sending unthreaded read receipts to checking the timeline's focus and `hide_threaded_events` associated values to see whether `ReceiptThread::Main` or `ReceiptThread::Thread` should be used.
2025-07-04 11:42:35 +03:00
Kévin Commaille
5448192ea4 Upgrade Ruma
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-07-04 09:53:29 +02:00
Benjamin Bouvier
8157193aef chore(ffi): adjust to uniffi-bindgen-go's expectations for types 2025-07-03 17:14:56 +02:00
Benjamin Bouvier
8b33806496 refactor(notification): have NotificationClient::get_notifications also return statuses 2025-07-03 17:14:56 +02:00
Benjamin Bouvier
72dcf5ed46 refactor(ffi): return some error info when a single notification couldn't be obtained 2025-07-03 17:14:56 +02:00
Benjamin Bouvier
58748bec3a chore(ffi): tweak alias names in the FFI layer
It doesn't make sense to name a thing "Matrix" when it comes from the
core SDK crate.

Also adjust a now slightly-incorrect doc comment for `get_notification`.
2025-07-03 17:14:56 +02:00
Benjamin Bouvier
f0b6225e40 feat(notifications): provide the NotificationStatus as the return type when getting notifications
This is more explicit for these API's users, which can decide to do
different things based on whether an event has been ignored, or filtered
out.
2025-07-03 17:14:56 +02:00
Johannes Marbach
308526a6bc feat(ffi): expose timestamp and identifier on EmbeddedEventDetails
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-02 12:38:53 +02:00
Benjamin Bouvier
9689c4a40a feat(ffi): add a new log pack for the notification client 2025-07-02 10:52:55 +02:00
Jonas Richard Richter
0d080935cf chore(changelog): add pull request reference for NotificationItem room topic addition 2025-06-30 11:26:17 +01:00
Jonas Richard Richter
4d140d8155 feat(notification): add room topic to NotificationItem and NotificationRoomInfo structs 2025-06-30 11:26:17 +01:00
Benjamin Bouvier
9d1c296657 doc(ffi): fix incorrect reference to a function that's been renamed 2025-06-30 10:48:27 +02:00
Jonas Platte
3d642356c6 refactor: Clean up formatting in many places
Process:
- set style_edition to 2024 in .rustfmt.toml
- run `cargo fmt`
- undo .rustfmt.toml change
- run `cargo fmt` again
- manually rewrap some strings
2025-06-27 19:54:13 +02:00
Doug
c6521a8aaf ffi: Remove the ElementWellKnown struct and related function. 2025-06-27 12:00:33 +02:00
Robin
6cc98ee9f7 feat(widget): Allow Element Call to learn the room name
The latest mobile designs for Element Call have it displaying the room name in an "app bar". So the Element Call widget will soon start requesting the capability to learn the room name, and the SDK should auto-approve this capability.
2025-06-26 13:28:34 +02:00
Timo
585ae29868 refactor(uniffi): make the sdk widget config struct derive uniffi.
This allows to not duplicate the struct in the uniffi crate.
2025-06-25 16:12:28 +03:00
Benjamin Bouvier
3919c2a89a feat(ffi): also disable the send queues when clearing caches
And beef up the doc comment.
2025-06-25 14:32:25 +02:00
Benjamin Bouvier
7c85e7aa4f feat(room list service): allow to manually expire sessions
This can be used to invalidate the persisted state on disk related to
the sliding sync positions. It's useful to do so when clearing up all
the caches, since the sliding sync `pos`itions are stored in the crypto
store (to benefit from the cross-process lock).
2025-06-25 14:32:25 +02:00
Stefan Ceriu
62231878cc fix(ffi): make RoomInfo power levels optional as they can be missing depending on the required state
The `m.room.power_levels` state event is not part of the room list required state and computing the RoomInfo would fail in that case.
2025-06-25 12:41:33 +03:00
Benjamin Bouvier
22c99f30f3 chore(sdk): fill in the pull request numbers in changelogs
Signed-off-by: Benjamin Bouvier <benjamin@bouvier.cc>
2025-06-25 10:32:01 +02:00
Benjamin Bouvier
a7efff9849 chore: add changelog entries 😅 2025-06-25 10:32:01 +02:00
Benjamin Bouvier
bc9192f818 refactor!(sdk): make the join_rule and related getters optional
The join rule state event can be missing from a room state. In this
case, it's an API footgun to return a default value; instead, we should
return none and let the caller decide what to do with missing
information.
2025-06-25 10:32:01 +02:00
Daniel Salinas
457af2a2f8 feat(wasm): Remove network config features from ffi ClientBuilder for Wasm (#5248)
<!-- description of the changes in this PR -->
Features to configure UserAgent, Proxy, Disabling SSL, and additional
certificates are not available on Wasm platforms. We remove these
configuration options from the FFI layer, while preserving them on
non-Wasm platforms.

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

<!-- Sign-off, if not part of the commits -->
<!-- See CONTRIBUTING.md if you don't know what this is -->
Signed-off-by: Daniel Salinas

---------

Co-authored-by: Daniel Salinas <danielsalinas@Daniels-MacBook-Pro-2.local>
2025-06-24 14:22:43 +02:00
Andy Balaam
7b38c442c7 refactor(crypto): Hold a DecryptionSettings in base Client
Previously, we held a TrustRequirement inside Client, and had to wrap it
in a DecryptionSettings manually a couple of times.

It feels more right to hold on to a DecryptionSettings directly. If
there were ever some additional settings, most likely we would need them
all here.

If I haven't screwed it up, this should not affect behaviour in any way.
2025-06-24 12:36:31 +01:00
Stefan Ceriu
dc6130562a feat(ffi): add simpler methods for checking own user permissions
This is so that the final client no longer needs to go through the string to user_id conversion and error handling step before retrieving permissions.
2025-06-23 18:04:59 +03:00
Stefan Ceriu
d1a14f895e chore(ffi): move user_power_levels outside the RoomInfo and into the newly introduced RoomPowerLevels.
`RoomPowerLevels` already holds an inner version of the power levels and has access to everything needed to compute the user to level map.
This way the async fetching only happens once and the mapping only on request.
2025-06-23 18:04:59 +03:00
Stefan Ceriu
b680705d15 feat(ffi): expose the RoomPowerLevels on the RoomInfo directly.
Currently, clients have to make async requests to `Room::get_power_levels` from multiple places throughout the app in order to correctly configure the various UI components and again, on randomly decided events, to keep them up to date.
This patch starts publishing the power levels directly on the `RoomInfo` and allows them to be handled (and updated!) through the normal `subscribe_to_room_info_updates` mechanism.
2025-06-23 18:04:59 +03:00
Stefan Ceriu
2b1ee853fc chore(ffi): move RoomInfo to the room module 2025-06-23 18:04:59 +03:00
Daniel Salinas
25d217cc6f Address timeline panic to avoid resume_unwind on Wasm 2025-06-23 10:06:04 +02:00
Jonas Platte
2116ad82df refactor: Move comments with visual indentation
Visual indentation was removed from rustfmt's style defaults in the 2024
edition of the style rules.
2025-06-23 09:37:45 +02:00
Jonas Platte
41f107e5ba refactor: Remove useless comment
This comment was added in the very first commit for matrix-sdk-ffi and I
have no recollection of what was meant there.
2025-06-23 09:37:45 +02:00
Daniel Salinas
ab699a90f1 Adjust platform init on Wasm to avoid tokio environment
The multi-threaded tokio environment does not work in Wasm.
console_error_panic_hook turns rust panics into JS console statements
2025-06-23 09:47:08 +03:00
Daniel Salinas
ddee7f8ccd feat(wasm): Small fixes for imports in ffi timeline (#5263)
Adjust some imports to use our shims to support Wasm.

Signed-off-by: Daniel Salinas
2025-06-20 22:22:15 +02:00
Daniel Salinas
08e1d3876b Reorganize QRCode related functionality into its own file
We have a working implementation of the additional forms of QR Code login
of MSC4108. This commit moves the existing code into its own file
to make future updates easier to follow.
2025-06-20 14:24:28 +01:00
Daniel Salinas
9676daee5a feat(wasm): Remove MediaFileHandle from ffi on Wasm platforms (#5249)
Remove the MediaFileHandle concept from the matrix-sdk-ffi crate on Wasm
platforms. File handles are not supported in the browser.

Signed-off-by: Daniel Salinas
2025-06-19 18:55:23 +02:00
Daniel Salinas
798cece4a2 feat(wasm): Add lib to matrix-sdk-ffi target (#5242)
The uniffi tool for generating JS/Wasm bindings utilizes rust as its
intermediate language.

As a result, the 'target' uniffi annotated library needs to be marked as
a 'lib' so that the generated rust code can utilize it to generate the
Wasm create + typescript bindings.

Signed-off-by: Daniel Salinas
2025-06-19 18:16:16 +02:00
Doug
06b387101b chore: Fix changelogs after rebase 2025-06-19 17:40:04 +02:00
Doug
bdb640a126 ffi: Expose a check for LiveKit RTC support. 2025-06-19 17:40:04 +02:00
Doug
c74295c604 chore: Refactor ServerCapabilities into ServerInfo.
It has nothing to do with /capabilities so is confusing. We can use this new struct to combine the well-known response into a single cache too.
2025-06-19 17:40:04 +02:00
Stefan Ceriu
47c8df0ef8 chore(ffi): move the room power levels to their own file and restructure the code 2025-06-19 17:55:48 +03:00
Stefan Ceriu
9f32dfe9a0 change(ffi): expose the full RoomPowerLevels object and move corresponding methods to it.
This patch expands on the already existent `RoomPowerLevels` record (which it renames to `RoomPowerLevelsValues` to work around uniffi not exposing public fields) and nests them inside a new exported object that also provides methods for retrieving the actions that an user can take, methods moved from the room object.
This reduces the amount of async calls the clients need to make, simplifies the API and groups the code better together.
2025-06-19 17:55:48 +03:00
Daniel Salinas
040fd6c736 Run cargo fmt 2025-06-19 16:16:59 +02:00
Daniel Salinas
4dac175db0 Back to other phrasing to make CI run 2025-06-19 16:16:59 +02:00
Daniel Salinas
5faf97cf99 Rework phrasing to make CI run 2025-06-19 16:16:59 +02:00