Commit Graph

1961 Commits

Author SHA1 Message Date
Stefan Ceriu
d36b2a6869 feat(ffi): introduce a ThreadSummary type within MsgLikeContent (#4933)
…that holds information on the thread the given item is the root of

- it holds the latest event content and sender at the moment but will
hold more information in the future e.g. number of replies, if it's
unread etc.
- the field is not currently being populate but is delivered earlier so
it can power shipping the UI side on the embedders
2025-04-16 09:11:31 +03:00
Jonas Richard Richter
4de202fc64 doc(changelog): add entry for room topic string in StateEventContent 2025-04-14 15:43:17 +02:00
Jonas Richard Richter
7b206d33f0 feat(ffi): update RoomTopic AnySyncStateEvent variant to include topic string 2025-04-14 15:43:17 +02:00
Jorge Martín
0306683cbf feat(ffi): Add extra details to ClientError.
Also split `ClientError::new` into `ClientError::from_str` and `ClientError::from_err` so we can automatically get the details from the 2nd one.
2025-04-11 15:49:20 +02:00
Ivan Enderlin
5d55bb4955 chore: Release matrix-sdk version 0.11.0 2025-04-11 10:51:30 +02:00
Mauro Romito
9300f47b40 feat(bindings): join_rule in NotificationItem 2025-04-11 10:29:59 +02:00
Mauro Romito
52f0aafb1e feat(bindings): expose is_public in notifications 2025-04-11 10:29:59 +02:00
Damir Jelić
ab90c1b945 refactor(sdk): Migrate away from the backoff crate to the backon crate
Since backon also has WASM support, this should mean that we can get rid
of the WASM specific HTTP client implementation.
2025-04-10 11:58:06 +02:00
Jorge Martín
005e506c9b refactor(ffi): expose Room::member_with_sender_info.
Reuse this for `RoomPreview` too, removing `RoomMembershipDetails`, which contained the same info.
2025-04-10 09:48:15 +02:00
Damir Jelić
f266fb9c38 chore(ffi): Update the changelog so it conforms to our cargo-release setup 2025-04-09 11:26:59 +02:00
Damir Jelić
2dfd334ade chore: Include the matrix-sdk-ffi crate in the release process 2025-04-09 11:26:59 +02:00
Stefan Ceriu
628440632d chore(ffi): move reactions from EventTimelineItem to MsgLikeContent to keep in line with the UI crate types 2025-04-08 17:47:17 +03:00
Stefan Ceriu
16a3d9d78b chore(ffi): introduce MsgLike Content and Kind and move mappings 2025-04-08 17:47:17 +03:00
Stefan Ceriu
d89a7d6c18 chore(ffi): move MsgLike related types to their own file 2025-04-08 17:47:17 +03:00
Stefan Ceriu
87c70789fe chore(ffi): move replies to their own file 2025-04-08 17:47:17 +03:00
Jorge Martín
3ece8e62b5 refactor(ffi): export NotificationItem::thread_id in the FFI layer 2025-04-08 11:53:39 +02:00
Ivan Enderlin
ee879354b7 doc(sqlite,ffi): Add #4894 in the CHANGELOG.mds. 2025-04-07 14:05:40 +02:00
Ivan Enderlin
c3fd571623 feat(ffi): Add ClientBuilder::system_is_memory_constrained().
This patch adds `ClientBuilder::system_is_memory_constrained`
so that the client can be built with that in mind.
Behind the scene, for the moment, it only calls
`SqliteStoreConfig::with_low_memory_config` instead of
`SqliteStoreConfig::new`, but this flag can be used for other use cases.
2025-04-07 14:05:40 +02:00
Ivan Enderlin
d9157e5b83 refactor(ffi): Call methods on Room instead of redoing the same work.
This patch updates `Room::report_content` and `Room::report_room` to
call the same methods on `matrix_sdk` instead of re-implementing them.
2025-04-07 11:54:25 +02:00
Ivan Enderlin
38378f7bae refactor(sdk): Reduce the size of Error::OAuth.
This patch boxes the error in `Error::OAuth` to reduce the size of this
variant (from 160 bytes to 16 bytes).
2025-04-04 13:25:55 +02:00
Kévin Commaille
43431b88da feat(sdk): Add Client::logout() to log out regardless of the auth API
It simplifies code for users, and avoids to have to match on
`AuthApi`, which is a non-exhaustive enum.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-04-04 13:14:55 +02:00
Stefan Ceriu
9f7179263a fix(ffi): correctly populate all audio content fields when converting from FFI types to Ruma
- fixes forwarding audio and voice messages that would previously show up as files because of missing fields
2025-04-03 15:50:17 +03:00
Kévin Commaille
c8da9cb462 refactor(oauth): Remove the issuer from OAuthAuthData
It is actually unused, and now that we only need homeserver URLs for
static registrations, users don't need to access it easily.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-04-03 12:52:17 +03:00
Kévin Commaille
678938951e chore: Update changelog for OAuthRegistrationStore removal
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-04-03 12:52:17 +03:00
Kévin Commaille
8883e081af refactor(oauth): Remove OAuthRegistrationStore
MSC2966 was updated, clients should re-register for every log in, so we
don't need to store the client IDs between logins.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-04-03 12:52:17 +03:00
Johannes Marbach
c4d9ec98c3 feat!(ffi): merge send_reply and send_thread_reply (#4880)
This pushes down the `Reply` struct to be provided when sending a reply, and merges the `send_reply` and `send_thread_reply` FFI functions.

This is a small follow-up on https://github.com/matrix-org/matrix-rust-sdk/pull/4852/files#r2016594024.

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-04-03 11:19:21 +02:00
Johannes Marbach
dccd836dc6 feat!(timeline): allow sending media as (thread) replies (#4852)
This makes it possible to reply with a media, as part of a thread or not.

Fixes #4835.

---------

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-04-02 12:25:06 +00:00
Benjamin Bouvier
42133a60c8 fix(ffi): use EventCache::clear_all_rooms() to clear the events caches
Clearing only the store backend, while not emptying the in-memory linked
chunks, will lead to out-of-sync state across the in-memory caches and
the database. As a result, it's safer to call the existing
`EventCacheInner::clear_all_rooms`, which will clear all the rooms
manually.
2025-04-02 13:54:43 +02:00
Ivan Enderlin
1a1310e205 doc(ffi,sqlite,sdk): Update CHANGELOG.mds. 2025-04-01 11:50:20 +02:00
Ivan Enderlin
d7b6fae2a3 feat(ffi): Add session_pool_max_size, …_cache_size and …_journal_size_limit.
This patch adds 3 methods on `ClientBuilder`:

1. `session_pool_max_size`,
2. `session_cache_size`,
3. `session_journal_size_limit`.

Respective fields are also added.

These values control the `SqliteStoreConfig`, used to control the
stores, especially their memory consumption.
2025-04-01 11:50:20 +02:00
Ivan Enderlin
d60810c2af refactor(ffi): Rename ClientBuilder::passphrase to session_passphrase.
This patch renames the `passphrase` method of `ClientBuilder` to
`session_passphrase` for more consistency with the `session_paths`
method.
2025-04-01 11:50:20 +02:00
Ivan Enderlin
a047784278 feat(ffi): Add Client::restore_session_with and RoomLoadSettings.
This patch adds `Client::restore_session_with` along with the
`RoomLoadSettings` enum.
2025-04-01 10:50:18 +02:00
Ivan Enderlin
7ac3fa1f4a refactor(ffi): Inline restore_session_inner.
This patch inlines the `restore_session_inner` into its unique call
site.
2025-04-01 10:50:18 +02:00
Stefan Ceriu
cb92971657 chore(ui): move TimelineItemContent::UnableToDecrypt to MsgLikeKind::UnableToDecrypt 2025-03-28 15:30:47 +02:00
Stefan Ceriu
5a35fec894 chore(ui): rename RedactedMessage to just Redacted 2025-03-28 15:30:47 +02:00
Stefan Ceriu
43b8f83e4b chore(ui): move TimelineItemContent::RedactedMessage to MsgLikeKind::RedactedMessage 2025-03-28 15:30:47 +02:00
Stefan Ceriu
76f92ba9af chore(ui): rename AggregatedTimelineItemContent to MsgLikeContent and AggregatedTimelineItemContentKind to MsgLikeKind.
- we decided on this naming convention to keep consistent with Ruma which uses `MsgLike` as well
2025-03-27 15:53:31 +02:00
Johannes Marbach
f3baf7efd2 refactor(timeline): push the reply logic down into matrix_sdk (#4842)
This achieves step 2 of #4835.

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-03-27 13:47:51 +01:00
Stefan Ceriu
4f3b40d6fb feat!(timeline): Introduce an extra TimelineItemContent layer that holds aggregations (#4839)
In preparation for threads we have realised that the `reactions`,
`thread_root` and `in_reply_to` were only available on `Message` types,
which doesn't play well with Stickers and Polls.

This PR introduces a new `Aggregated` `TimelineItemContent` variant
which holds the message `kind` (Message, Sticker, Poll) as well as well
as any related aggregated data. it will help treat them all in a similar
fashion as well as account for future changes.

There are no functional changes, it's mostly about moving code around
and the FFI interfaces haven't changed.

Part of #4833.
2025-03-26 16:27:03 +00:00
Kévin Commaille
e0e9c06ca4 Don't use serde to avoid returning an error
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-03-26 15:26:55 +01:00
Kévin Commaille
eb313efdeb Don't qualify error! macro
It's already imported.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-03-26 15:26:55 +01:00
Kévin Commaille
bc22ff1221 refactor(oauth): Introduce AccountManagementUrlBuilder
It allows to reuse the URL for different actions more easily than having
to call `OAuth::account_management_url` every time for a different
action.

It also adds a method with fallback if we want to ignore action
serialization errors, to always present a URL.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-03-26 15:26:55 +01:00
Benjamin Bouvier
f5b6767253 feat(timeline): add a timeline start virtual item 2025-03-26 11:33:20 +01:00
Benjamin Bouvier
b83889dcba fix(ffi): propagate initial values before the future is picked by a runtime 2025-03-26 11:18:23 +01:00
Benjamin Bouvier
fc8a6dc9b1 refactor(ffi): always try to load InReplyToDetails from the event cache or network 2025-03-25 11:06:31 +01:00
Johannes Marbach
f8236a8b96 feat(timeline): add functions for sending messages in threads
`send_reply` is geared towards clients that don't render threads themselves. It sends a reply and optionally forwards it onto any existing thread.

This PR adds `send_thread_reply` for clients that do render threads themselves. This sends a message onto a thread, regardless of whether a thread existed before, and includes the fallback for non-threaded clients only if the message is not itself a reply on the thread.

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-03-24 14:31:20 +01:00
Kévin Commaille
f6c5addf55 refactor(sdk): Remove experimental-oidc feature
Now that is compiles under WASM and that the API was cleaned up, it
should be okay.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-03-24 14:04:04 +02:00
Kévin Commaille
b3e82a05db refactor(oauth): Merge OAuth::login_with_oidc_callback() and OAuth::finish_login()
Accept a URL or a query string for simplicity.

That way we don't need to expose AuthorizationResponse.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-03-21 19:17:13 +01:00
Kévin Commaille
a8aa364757 refactor(oauth): Allow to use any registration method with OAuth::login
Gets rid of OAuth::url_for_oidc since it can be replaced by a call to
OAuth::login now.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-03-21 19:17:13 +01:00
Kévin Commaille
7457ecb1a8 feat(oauth): Allow to use any registration method with login_with_qr_code
Introduces the ClientRegistrationMethod type

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-03-21 19:17:13 +01:00