Commit Graph

11735 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
matrix-sdk-ffi/20250422
2025-04-16 09:11:31 +03:00
Richard van der Hoff
ed232df0b6 Merge pull request #4864 from matrix-org/rav/history_sharing/upload_bundle
crypto: encrypt, upload and share keys for room history
2025-04-15 18:00:03 +01:00
Richard van der Hoff
1a4f6effda Merge branch 'main' into rav/history_sharing/upload_bundle
Signed-off-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2025-04-15 17:43:01 +01:00
Richard van der Hoff
dc6fe93d1e crypto: fix changelog for 0.10.0 and 0.11.0 (#4939)
PR #4670 didn't land until 0.11.0.
2025-04-15 17:12:32 +01:00
Benjamin Bouvier
a5537a8f24 fix(event cache): don't ditch a previous-batch token when we didn't have initial events (#4936)
See #4891 that shows a case where we should have saved the
previous-batch token, and instead ditched it, in the previous version.

Changes include:
- moving the code deciding to keep or ditch the `previous-batch` token
into `append_events_locked`.
- tweak the condition to ditch, so that the `previous-batch` token is
ditched only if we didn't have events in the event cache in the first
place, in addition to having storage + the timeline not being marked as
limited explicitly.

Credits to @zecakeh for the test case.
2025-04-15 15:29:11 +00:00
Benjamin Bouvier
a27d6e2655 multiverse: prefer rendering back-paginated events instead of timeline's tail
This is useful to observe the virtyual start of timeline item in manual
testing.
2025-04-15 16:31:20 +02:00
Richard van der Hoff
bce6c19bba Merge branch 'main' into rav/history_sharing/upload_bundle
Signed-off-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2025-04-15 14:32:42 +01:00
Ivan Enderlin
22d092b83c chore(base): Rename ephemeral_events to dispatch_ephemeral_events. 2025-04-15 14:17:07 +02:00
Ivan Enderlin
ee5671bef5 chore(base): Rename Room to RoomCreationData. 2025-04-15 14:17:07 +02:00
Ivan Enderlin
0b58b9112d chore(base): Make Clippy happy. 2025-04-15 14:17:07 +02:00
Ivan Enderlin
0fed5147b9 chore(base): Use Entry::or_default() to simplify code. 2025-04-15 14:17:07 +02:00
Ivan Enderlin
b06234149f chore(base): Fix imports and e2e-encryption. 2025-04-15 14:17:07 +02:00
Ivan Enderlin
739f306bf0 refactor(base): Create the room::msc4186::extensions::room_account_data response processor.
This patch is twofold:

1. it transforms the `&mut` to a `&` for the room account data in the
   sliding sync flow, which allows to remove one big clone!
2. it adds the `room_account_data` response processor.
2025-04-15 14:17:07 +02:00
Ivan Enderlin
5f3c96607f refactor(base): Create the room::msc4186::extensions::ephemeral_events response processor.
This patch creates the new `room::msc4186::extensions::ephemeral_events`
response processor.

Ideally we would like to merge this with `ephemeral_events`, but they
are a bit different. Let's see how it evolves in the future.
2025-04-15 14:17:07 +02:00
Ivan Enderlin
235facb793 refactor(base): room::sync_v2::update_(joined|left)_room use room::Room.
This patch uses the `room::Room` structure in `room::sync_v2` to
reduce the number of arguments of the `update_joined_room` and the
`update_left_room` processors.
2025-04-15 14:17:07 +02:00
Ivan Enderlin
9adb0deaa5 refactor(base): room::msc4186::update_any_room uses room::Room.
This patch uses the `room::Room` structure in
`room::msc4186::update_any_room` to reduce its number of arguments. It
results in the removal of te `allow(clippy::too_many_arguments)`.
2025-04-15 14:17:07 +02:00
Ivan Enderlin
61b711ce76 chore(base): Create the room::Room structure.
This patch creates the `room::Room` structure to group common arguments
in the `room` processors.
2025-04-15 14:17:07 +02:00
Ivan Enderlin
9e6dc71609 refactor(base): Remove the BaseStateStore argument in room:sync_v2::* processors.
This patch removes the `BaseStateStore` argument in `room::sync_v2::*`
response processors as it can be fetched from the `Notification`
argument.
2025-04-15 14:17:07 +02:00
Ivan Enderlin
33b1c02873 chore(base): Rename room_data to room_response.
This patch tries to clarify that the `room_data` _is_ the HTTP response.
2025-04-15 14:17:07 +02:00
Ivan Enderlin
f4ad575090 refactor(base): Remove SessionMeta from update_any_room.
This patch removes the `SessionMeta` argument of
`room::msc4186::update_any_room`. Tracking its usage, it reveals that
providing a `UserId` is sufficient. Happily, we already provide a
`UserId`, hence making `SessionMeta` useless here.
2025-04-15 14:17:07 +02:00
Ivan Enderlin
f55730716a chore(base): Rename a variable room_type to room_state. 2025-04-15 14:17:07 +02:00
Ivan Enderlin
bad1c683f8 chore(base): Rename fields of RoomUpdate.
This patch renames the fields in `RoomUpdate`: `join` becomes `joined`,
`leave` becomes `left`, `invite` becomes `invited`, to match their
associate type.
2025-04-15 14:17:07 +02:00
Ivan Enderlin
2479339c46 refactor(base): Simplify the flow of membership.
This patch simplifies the flow of `membership` when the room is an
invited room.

Previously, we were creating the room as `Invited`. Then, later
overriding it to `Knocked` if we found it was such a room. Otherwise, we
were overriding it again to `Invited`. Well. Now the flow is simpler.
2025-04-15 14:17:07 +02:00
Ivan Enderlin
45d5d1a802 refactor(base): Remove the numerous Option<…> returned by update_any_room.
This patch removes the 4 `Option<…>` returned by `update_any_room`: they
are replaced by a single new `RoomUpdateKind` enum.
2025-04-15 14:17:07 +02:00
Ivan Enderlin
a218105aca refactor(base): Create the room::msc4186::update_any_room response processor.
This patch extracts the `BaseClient::process_sliding_sync_room` method
into the new `msc4186::update_any_room` response processor. So far, this
is purely a code move, without any changes (modulo method-to-function
transformation).

With `BaseClient:process_sliding_sync_room` comes
`BaseClient::process_sliding_sync_room_membership`,
`BaseClient::handle_own_room_membership`, `process_room_properties` and
`cache_latest_events`.
2025-04-15 14:17:07 +02:00
Ivan Enderlin
6bbb7fb498 chore(base): Remove unnecessary comments.
This patch removes comments that are irrelevant today. There is nothing
to fix.
2025-04-15 14:17:07 +02:00
Richard van der Hoff
80db096be8 crypto: fix changelog 2025-04-15 12:55:55 +01:00
Richard van der Hoff
9ef1a040dd test: add the start of an integration test for room history sharing
This is only a partial test, since we haven't yet implemented the receiver side
of the history-sharing messages.
2025-04-15 12:55:55 +01:00
Richard van der Hoff
f11158ab6c sdk: send out the to-device requests created by Room::share_history 2025-04-15 12:55:55 +01:00
Richard van der Hoff
84a030aed0 crypto: Support for encrypting and sending room key history bundle data
For each device belonging to the user, encrypt and send to-device messages
containing the bundle data
2025-04-15 12:55:55 +01:00
Richard van der Hoff
7b25a50a51 sdk: add Room::share_history
The next step in our work on sharing encrypted room history. Add a method to
`matrix_sdk::room::Room` which will upload an encrypted key bundle.
2025-04-15 12:55:55 +01:00
Ivan Enderlin
f32d0099fc chore(base): Make Clippy happy. 2025-04-15 11:57:39 +02:00
Ivan Enderlin
6d9cf861f6 chore(base): Remove the re-exports in timeline::builder.
This patch removes the re-exports of `Notification` and `E2EE` in
`timeline::builder`. Let's make things simple now that they are used
outside the `timeline` processors.
2025-04-15 11:57:39 +02:00
Ivan Enderlin
13e565a4dc refactor(base): Create the room::sync_v2::update_knocked_room response processor.
This patch creates the `update_knocked_room` processor, extracted from
the sync v2 flow.
2025-04-15 11:57:39 +02:00
Ivan Enderlin
aeca1f1495 refactor(base): Use Notification wherever possible.
This patch groups arguments behind the `Notification` struct
if it makes sense. This patch also uses the new method
`Notification::push_notification_from_event_if` method to replace
duplicated code.
2025-04-15 11:57:39 +02:00
Ivan Enderlin
c16bc6b435 refactor(base): Move and improve the Notification struct in response processors.
This patch moves the `timeline::builder::Notification` into
its own module, `notification`. This patch adds two methods:
`push_notification` and `push_notification_from_event_if`.
2025-04-15 11:57:39 +02:00
Ivan Enderlin
846fcfb408 feat(base): Add From implementations to build a RawAnySyncOrStrippedTimelineEvent.
This patch adds two `From` implementations on
`RawAnySyncOrStrippedTimelineEvent` to create the correct variant of
this enum. This is useful when we get generic types and want to build
this type.
2025-04-15 11:57:39 +02:00
Ivan Enderlin
1141b7db1a refactor(base): Create the room::sync_v2::update_invited_room response processor.
This patch creates the `update_invited_room` processor by extracting the
code for the sync v2 flow.
2025-04-15 11:57:39 +02:00
Ivan Enderlin
b85a1a0998 refactor(base): Create the room::sync_v2::update_left_room response processor.
This patch creates the `update_left_room` processor, extracted from the
sync v2 flow.

I've noticed that `new_user_ids` is not used, so it has been put behind
a `_` variable for the moment, but some computations have been removed.
We need to clean this user ID flow.
2025-04-15 11:57:39 +02:00
Ivan Enderlin
e62313d7ba reefactor(base): Create the room::sync_v2::update_joined_room response processor.
This patch extracts the logic to handle a `JoinedRoom` in a response
processor.
2025-04-15 11:57:39 +02:00
Ivan Enderlin
71510de602 refactor(base): Extract timeline::builder::E2EE into e2ee, and use it more.
This patch moves the `timeline::builder::E2EE` type into the `e2ee`
module. Gathering these 3 E2EE values in the same type was a good idea,
and is now applied to more places in the response processors.
2025-04-15 11:57:39 +02:00
Ivan Enderlin
28888a414b refactor(base): Compute now if and only if Level::INFO is enabled.
This patch computes the `now` variable if and only if it is required.
It is used by an `info!` log, so let's condition the creation of `now`
to that.
2025-04-15 11:57:39 +02:00
Ivan Enderlin
3538bb91e3 refactor(base): Context derives Default.
This patch makes `Context` to derive `Default`. The `new` constructor
also no longer takes a `RoomInfoNotableUpdates`, since it was always
used with a default value, it generates this value by itself.
2025-04-15 11:57:39 +02:00
Ivan Enderlin
fdcc6dbeda chore(base): Replace an unwrap by an expect.
This patch updates a comment and replaces an `unwrap` by an `expect`.
2025-04-15 11:57:39 +02:00
dependabot[bot]
f1cd8120a8 chore(deps): Bump tj-actions/changed-files
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 6f67ee9ac810f0192ea7b3d2086406f97847bcf9 to 9b4bb2bedb217d3ede225b6b07ebde713177cd8f.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](6f67ee9ac8...9b4bb2bedb)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-version: 9b4bb2bedb217d3ede225b6b07ebde713177cd8f
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-15 11:31:54 +02:00
Richard van der Hoff
473852c7d5 Merge pull request #4922 from matrix-org/rav/check_sender_device_keys
crypto: check `sender_device_keys` on incoming Olm messages
2025-04-15 10:18:50 +01:00
Ivan Enderlin
f19f8b25db fix(sdk): Remove include_heroes in sliding sync requests.
This patch removes all mentions of `include_heroes`. This field isn't
part of the MSC4186. We have the `test_compute_heroes_from_sliding_sync`
which continues to pass, everything fine on that side. There is no
mention of `include_heroes` in Synapse at the time of writing. It seems
to be an artifact from the sliding sync proxy experiment.
2025-04-14 18:26:27 +02: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
Ivan Enderlin
085de8bdae refactor(base): Create the ephemeral_events response processor.
This patch creates the `ephemeral_events` response processors:
`dispatch` and `dispatch_one`.

This remove duplicated code.
2025-04-14 08:48:18 +02:00