Commit Graph

13223 Commits

Author SHA1 Message Date
Benjamin Bouvier
a3c82e9087 chore(deps): bump reqwest to 0.12.15 2025-05-22 11:50:13 +02:00
Benjamin Bouvier
56082f93d0 chore(sdk): forward "database is busy" errors to sentry 2025-05-22 11:50:13 +02:00
Benjamin Bouvier
c8474511a7 feat(ffi): add support for sentry logging 2025-05-22 11:50:13 +02:00
Ivan Enderlin
1348525447 test(base): Fix a test. 2025-05-21 17:26:52 +02:00
Ivan Enderlin
56f9b2d9f6 chore(base): Rename rooms to room.
This patch renames the `rooms` module into `room`. It contains a single
kind of `Room`.
2025-05-21 17:26:52 +02:00
Ivan Enderlin
b18680b853 test(base): Use SystemTime from web_time for Wasm. 2025-05-21 17:26:52 +02:00
Ivan Enderlin
72b2763dad chore(base): Run rustfmt from nightly. 2025-05-21 17:26:52 +02:00
Ivan Enderlin
7278a36704 chore(base): Move Room::get_member_hints in the display_name module.
This patch moves the `Room::get_member_hints` method inside the newly
created `display_name` module. That way it is isolated from the rest of
the codebase.
2025-05-21 17:26:52 +02:00
Ivan Enderlin
bd9a895089 chore(base): Move Room::*room_call* methods in the new call module.
This patch moves the `Room::has_active_room_call` and
`Room::active_room_call_participants` methods into the new `call`
module. This patch also moves the associated tests in this new module.
2025-05-21 17:26:52 +02:00
Ivan Enderlin
a71e7923e0 chore(base): Move the Room::MAX_ENCRYPTED_EVENTS constant in latest_event.
This patch moves the declaration of the `Room::MAX_ENCRYPTED_TESTS`
constants in the `latest_event` module.
2025-05-21 17:26:52 +02:00
Ivan Enderlin
2433e91a6c chore(base): Move the m.room.create wrapper types in the new create module.
This patch moves the `m.room.create` wrapper types, aka
`RoomCreateWithCreatorEventContent` type and siblings, in the new
`create` module.
2025-05-21 17:26:52 +02:00
Ivan Enderlin
48d2a1543c chore(base): Move code inside the same module.
This patch puts tests at the end of the file.
2025-05-21 17:26:52 +02:00
Ivan Enderlin
bcd75362f7 chore(base): Move Room::*knock* methods into the new knock module.
This patch moves the `Room::*knock*` methods into the new `knock`
module.

The idea is to group API by “theme” to get smaller modules and more
organised code.
2025-05-21 17:26:52 +02:00
Ivan Enderlin
f4488e42a2 chore(base): Move Room::state and sibling types into new state module.
This patch moves the `Room::state` method, along with the ``RoomState`
and `RoomStateFilter` types into the new `state` module. This patch also
moves the tests in this new module.

The idea is to group API by “theme” to get smaller modules and more
organised code.
2025-05-21 17:26:52 +02:00
Ivan Enderlin
3d13b60b68 chore(base): Merge rooms::normal into rooms.
This patch merges the `rooms/normal.rs` file into `rooms/mod.rs`.

The name `normal` is present for historical reasons that no longer stand
today. This is no needed anymore. Let's simplify the modules.
2025-05-21 17:26:52 +02:00
Ivan Enderlin
f1c54d1e27 chore(base): Move tests in the correct module.
This patch move tests about the `RoomDisplayName` in the newly created
`display_name` module.
2025-05-21 17:26:52 +02:00
Ivan Enderlin
27edb163e9 chore(base): Move tests in the correct module.
This patch moves tests about `RoomNotableTags` in the newly created
`tags` module.
2025-05-21 17:26:52 +02:00
Ivan Enderlin
6d9d202701 chore(base): Move Room::*latest_event*() inside the new latest_event module.
This patch moves everything related to the `Room` latest event API
inside the new `latest_event` module. This patch also moves the tests.
The idea is to get a smaller `rooms::normal` module, and to clarify the
code by grouping `Room` APIs by “theme”.
2025-05-21 17:26:52 +02:00
Ivan Enderlin
61d99ef709 chore(base): Move everything related to Room members in members.
This patch moves all types and methods used by or implemented on `Room`
inside the existing `members` module.
2025-05-21 17:26:52 +02:00
Ivan Enderlin
6f031261d5 chore(base): Move Room::is_favourite and ::is_low_priority into new tags module.
This patch moves the  Room::is_favourite` and `::is_low_priority`, along
with the `RoomNotableTags` into the new `tags` module. This patch also
moves the tests in this new module.

The idea is to group API by “theme” to get smaller modules and more
organised code.
2025-05-21 17:26:52 +02:00
Ivan Enderlin
4a57044680 chore(base): Move Room::encryption_* mtehods into new encryption module.
This patch moves the `Room::encryption_state()` and
`Room::encryption_settings()` methods, and the sibling types, into a new
`encryption` module. This patch also moves the tests in this new module.
The idea is to group `Room` API by “theme” in modules, to clarify the
code.
2025-05-21 17:26:52 +02:00
Ivan Enderlin
d5c0e209fc chore(base): Move Room::display_name() and siblings into new display_name module.
This patch moves the `Room::display_name()` method, and all the
siblings, into a new `display_name` module. It includes types like
`RoomDisplayName`, `UpdatedRoomDisplayName`, `RoomSummary` etc. This
patch also moves the tests in this new module. The idea is to group
`Room` API by “theme” in modules, to clarify the code and to make the
big `rooms::normal` module smaller.
2025-05-21 17:26:52 +02:00
Ivan Enderlin
737654549b chore(base): Move the Room's room info related methods and tests in room_info.
This patch moves the `Room::subscribe_info`, `::clone_info` and
`::set_room_info` methods from the `rooms::normal` module to the
`rooms::room_info` module. This patch also moves the tests related to
room info inside `room_info`.
2025-05-21 17:26:52 +02:00
Ivan Enderlin
cc34603864 chore(base): Move RoomInfoNotableUpdate* inside room_info.
This patch moves the `RoomInfoNotableUpdate` and
`RoomInfoNotableUpdateReasons` types inside the `room_info` module.
2025-05-21 17:26:52 +02:00
Ivan Enderlin
bad82ccd42 doc(ui): Explain why m.room.create is necessary.
This patch explains why having `m.room.create` is necessary. It's not
only about the room previews, but also about the room versions, and thus
the tombstoned rooms.
2025-05-21 17:26:52 +02:00
Ivan Enderlin
d71cd68a90 refactor(base): Rename RoomInfo::version to data_format_version.
This patch renames the `RoomInfo::version` field to
`data_format_version` to avoid all possible confusion with the
`room_version` (from `m.room.create`).
2025-05-21 17:26:52 +02:00
Benjamin Bouvier
726111b073 refactor(timeline): group all the parameters for a remote echo in TimelineAction::from_content 2025-05-21 16:59:41 +02:00
Benjamin Bouvier
298fa7d5d2 feat(timeline): pass the encryption info for a bundled edit when constructing the edit aggregation
This should properly update shields in case the bundled edit was
correctly decrypted.
2025-05-21 16:59:41 +02:00
Benjamin Bouvier
4a627baae8 feat(timeline): indicate when the replied-to event is not a standalone item
If the replied-to event is an aggregation, the
`RepliedToEvent::try_from_timeline_event` will now return `Ok(None)`,
and the caller may handle this as they please.

In the FFI layer, this will be filled with an error message indicating
that the event is unsupported.
2025-05-21 15:52:31 +02:00
Benjamin Bouvier
560e33c27b refactor(timeline): deduplicate parsing of events when making a RepliedToEvent 2025-05-21 15:52:31 +02:00
Stefan Ceriu
d84cf0614d change(ffi): return errors if the client or utd delegates were already set 2025-05-21 16:38:20 +03:00
Stefan Ceriu
3f1bc2591e chore(ffi): report an error if the timeline is set to report UTDs but the hook manager isn't configured 2025-05-21 16:38:20 +03:00
Stefan Ceriu
8e83b724da chore(ffi): rename the utd_hook to utd_hook_manager 2025-05-21 16:38:20 +03:00
Stefan Ceriu
767b10f5e2 change(ffi): remove now unused ClientDelegate did_refresh_tokens callback (dropped in favor of the ClientSessionDelegate) 2025-05-21 16:38:20 +03:00
Stefan Ceriu
4e2b5562f1 change(ffi): use a OnceLock to guard against multiple settings of the ClientDelegate 2025-05-21 16:38:20 +03:00
Stefan Ceriu
8ef471b492 chore(multiverse): simplify marking a room as read 2025-05-21 16:38:20 +03:00
Stefan Ceriu
de6998dbe0 change(ffi): move the UTD delegate directly to the client for ease of use 2025-05-21 16:38:20 +03:00
Stefan Ceriu
e48b1f6056 change(ffi): stop retrieving room list last messages from through the timeline
As per the plan defined in #4718:

```
the room_list_service::room::RoomInner shouldn't make use of its inner timeline;
it's only used in a direct getter, or to compute the latest room event, but it's not working
as intended, since local echoes aren't properly displayed in the room list.
This non-working feature can be removed, in favor of #4112
```
2025-05-21 16:38:20 +03:00
Stefan Ceriu
7074110780 change(ffi): remove the UTD manager from the sync service, room list service and room list items 2025-05-21 16:38:20 +03:00
Stefan Ceriu
c90d272374 change(ffi): add timeline configuration option for reporting UTDs 2025-05-21 16:38:20 +03:00
Stefan Ceriu
e6dc203c4d change(ffi): pass the client utd manager down into the timeline builder 2025-05-21 16:38:20 +03:00
Stefan Ceriu
195ee35eea change(ffi): move the utd hook from the sync service to the client 2025-05-21 16:38:20 +03:00
Stefan Ceriu
70122a4407 change(ui): stop relying on a room's stored timeline for marking it as read 2025-05-21 16:38:20 +03:00
Stefan Ceriu
f2ca0697af chore(ui): remove the timeline's builder method and make the builder's constructor public 2025-05-21 16:38:20 +03:00
Kévin Commaille
9f196be2f6 Fix doc link
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-05-21 13:51:48 +02:00
Kévin Commaille
254d86bc45 refactor(ui): Set room as variable instead of calling self.room() every time
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-05-21 13:51:48 +02:00
Kévin Commaille
a8dcea6931 refactor(sdk): Make Room::set_unread_flag() a no-op if the unread flag already has the wanted value
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-05-21 13:51:48 +02:00
Kévin Commaille
eed04ecdb3 chore: Add changelog entries for #5055
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-05-21 13:51:48 +02:00
Kévin Commaille
c131e0cfe5 test(ui): Add tests for unsetting the unread flag when sending receipts
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-05-21 13:51:48 +02:00
Kévin Commaille
5f01c72a48 refactor(ui): Use the new mock endpoints in tests
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-05-21 13:51:48 +02:00