Commit Graph

13223 Commits

Author SHA1 Message Date
Kévin Commaille
bf7d5e7841 feat(ui): Unset the unread flag when sending unthreaded receipts in Timeline
Updates the unread flag or the room in `Timeline::send_single_receipt()`
and `Timeline::send_multiple_receipts()` if the room is marked as unread
and the receipts are unthreaded.

Updates it also in `Timeline::mark_as_read()`, even if there is no
latest event ID.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-05-21 13:51:48 +02:00
Kévin Commaille
dff1886015 test(sdk): 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
14a73dc932 refactor(sdk): Use new mock endpoints for tests
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-05-21 13:51:48 +02:00
Kévin Commaille
51be581d48 feat(test): Add RoomAccountDataTestEvent::MarkedUnread
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-05-21 13:51:48 +02:00
Kévin Commaille
0a41febe15 test(sdk): Mock endpoints for sending receipts and room account data
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-05-21 13:51:48 +02:00
Kévin Commaille
63eb429843 feat(sdk): Unset the unread flag when sending unthreaded receipts in Room
Updates the unread flag or the room in `Room::send_single_receipt()` and
`Room::send_multiple_receipts()` if the room is marked as unread and the
receipts are unthreaded.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-05-21 13:51:48 +02:00
Mauro
91815ab678 feat(bindings): added APIs to get the media preview config from the store 2025-05-21 12:15:17 +02:00
Benjamin Bouvier
a98f71ed0c feat(timeline): handle live aggregations on non-live timelines (#5060)
This makes it possible to handle reactions/redactions/edits/etc. on
non-live timelines. As a result, the pinned and focused timelines will
now get live reactions/redactions and so on. This makes it possible to
also have the thread timelines handle those live events, although it's
unclear how it will pane out in the end, when the event cache is also
involved.
2025-05-20 18:03:57 +02:00
Benjamin Bouvier
6f8b744c24 refactor(timeline): address review comments 2025-05-20 13:50:02 +02:00
Benjamin Bouvier
5e9c76f476 refactor(timeline): avoid cloning of relates_to for room messages
This can be done by splitting the handling of the msgtype/mentions from
the handling of the `relates_to` field, requiring a few API changes here
and there.
2025-05-20 13:50:02 +02:00
Benjamin Bouvier
4fd0f2a32c refactor(timeline): slightly optimize flow for saving a bundled edit
We only need the edit_json if we're about to save the edit aggregation.
Likewise, if there's no current event id (i.e. the event being handled
is a local echo), then we don't need to even try to extract anything
from the bundle information.
2025-05-20 13:50:02 +02:00
Benjamin Bouvier
74d5d6e265 refactor(timeline): group extracting the reply and thread root
The poll events's `related_to` field is a `RelationWithoutReplacement`,
while the two others are `Relation<C>`, where `C` is the event content
type (in case it was replacement). As a matter of fact, we try
converting the `Relation<C>` into a `RelationWithoutReplacement` (which
unfortunately requires cloning, which is wasteful if the relation was a
replacement indeed), and then we can use a single function to extract
the reply information and thread root info, for all three.
2025-05-20 13:50:02 +02:00
Benjamin Bouvier
caa53be00e optimize(timeline): find the position of an event by starting from the end 2025-05-20 13:50:02 +02:00
Benjamin Bouvier
b3086accd5 refactor(timeline): hey, i can actually remove this pending_edits field now 2025-05-20 13:50:02 +02:00
Benjamin Bouvier
f010587201 chore: make clippy happy
bleh.
2025-05-20 13:50:02 +02:00
Benjamin Bouvier
2af751d8c6 optimize(timeline): avoid one clone if a new item has pending aggregations 2025-05-20 13:50:02 +02:00
Benjamin Bouvier
f36f9915d1 refactor(timeline): simplify a few functions as a result of not providing the edit json ahead of time 2025-05-20 13:50:02 +02:00
Benjamin Bouvier
e8f8e7bfd6 fix(timeline): properly update encryption info upon edit
To be fair, this is a regression from a previous commit in this PR.
2025-05-20 13:50:02 +02:00
Benjamin Bouvier
dbe23777a0 refactor(timeline): use the aggregations manager for handling edits 2025-05-20 13:50:02 +02:00
Benjamin Bouvier
b7191e3dc2 refactor(timeline): have Aggregations::try_remove_aggregation also take care of updating the item 2025-05-20 13:50:02 +02:00
Benjamin Bouvier
56ce93ce72 refactor(timeline): simplify a bit mark_aggregation_as_sent by having it do more work
This avoids another struct definition, and items are going to be needed
for edits anyways.
2025-05-20 13:50:02 +02:00
Benjamin Bouvier
9cbc674cf2 optimize(timeline): don't eagerly clone an EventTimelineItem before applying an aggregation onto it 2025-05-20 13:50:02 +02:00
Benjamin Bouvier
16fe53c40d refactor!(timeline): have TimelineItem::reactions() return an Option<&ReactionsByKeyBySender> instead of owned non-optional 2025-05-20 13:50:02 +02:00
Benjamin Bouvier
1b581d52e8 refactor(timeline): rename Aggregations::apply to Aggregations::apply_all
It applies *all* the stashed aggregations for a given event timeline
item.
2025-05-20 13:50:02 +02:00
Benjamin Bouvier
dd6604e9f3 feat(timeline): handle redaction in the pending aggregations
This allows having a redaction event come before the related event, and
still handle it when the redacted event shows up.
2025-05-20 13:50:02 +02:00
Yousef Moazzam
f173510482 test: Replace sync_timeline_event! with EventFactory for beacon events in room integration tests 2025-05-20 12:31:23 +02:00
Benjamin Bouvier
905d9b9aba refactor(timeline): don't reload a pinned event timeline that hasn't changed since the previous time 2025-05-20 10:49:08 +02:00
Benjamin Bouvier
810056cd4d refactor(timeline): add logging for the pinned events task 2025-05-20 10:49:08 +02:00
Richard van der Hoff
4d2c261ff8 crypto: rewrite check_sender_trust_requirement to use VerificationState (#5044)
There are two reasons for this.

Firstly. we've already done a bunch of work to map `SenderData` into a
`VerificationState`, and the decision tree from `VerificationState` to
allow/reject is simpler than going from `SenderData`, even if we have to
fudge it a bit to get the "legacy" flag. (Note that it allows us to get
rid of an `unreachable!` panic.)

Secondly, `VerficationState` represents the state of an *event*, whereas
`SenderData` is about the session as a whole. A session can be fine,
whilst events (claiming to be) encrypted with it can be suspect. What we
want here is to check a specific message. Currently, this doesn't make
any functional difference, but conceptually it's cleaner to check the
`VerificationState`.

Note that there are a bunch of tests for this method in
`matrix-sdk-crypto/src/machine/tests/decryption_verification_state.rs`,
called `test_decryption_trust_requirement`.
2025-05-19 18:35:21 +01:00
Ivan Enderlin
d4626835bb chore(base): Fix formatting. 2025-05-19 16:09:32 +02:00
Ivan Enderlin
f684883902 chore(base): Move RoomInfo inside another module.
This patch moves the `RoomInfo` type and its implementations inside the
`room_info` module.
2025-05-19 16:09:32 +02:00
Ivan Enderlin
cf6316e290 chore(base): Move BaseRoomInfo into its own module.
This patch extracts the `BaseRoomInfo` type and its implementations
inside its own module.
2025-05-19 16:09:32 +02:00
Ivan Enderlin
12caf12d8a doc(base): Fix a typo. 2025-05-19 16:09:32 +02:00
Ivan Enderlin
9809e1b53c doc(sdk): Fix a typo in an inline comment. 2025-05-19 15:58:58 +02:00
Ivan Enderlin
80b7eed14b task(sdk): Fix warnings error without e2e-encryption. 2025-05-19 15:58:58 +02:00
Ivan Enderlin
6980dc5628 doc(sdk): Add #5047. 2025-05-19 15:58:58 +02:00
Ivan Enderlin
9366bc85e9 refactor(sdk): Remove FrozenSlidingSync.
This patch removes `FrozenSlidingSync`. Its unique field is supposed to
be stored in the crypto store.
2025-05-19 15:58:58 +02:00
Ivan Enderlin
0c193500d2 refactor(sdk): Remove SlidingSyncRoom \o/.
This patch FINALLY removes `SlidingSyncRoom`, youhou!
2025-05-19 15:58:58 +02:00
Ivan Enderlin
6c68cef6e0 refactor(sdk): Remove SlidingSync::rooms.
This patch removes the `SlidingSync::rooms` field. A cascade of removal
happens, and many part of the code is simplified. The most notable is
`FrozenSlidingSync`.
2025-05-19 15:58:58 +02:00
Ivan Enderlin
5a7a42cde3 refactor(sdk): Stop maintaining SlidingSync::rooms.
This patch stops maintaining/updating `SlidingSync::rooms`. The goal is
to remove `SlidingSyncRoom`.
2025-05-19 15:58:58 +02:00
Ivan Enderlin
0ad88842cc refactor(sdk): Remove SlidingSync::get_rooms and get_all_rooms.
This patch removes `SlidingSync::get_rooms` and `get_all_rooms`. The
goal is to remove `SlidingSyncRoom`.
2025-05-19 15:58:58 +02:00
Ivan Enderlin
7c0f7f4715 refactor(sdk): Remove SlidingSync::get_number_of_rooms.
This patch removes `SlidingSync::get_number_of_rooms`. The goal is to
remove `SlidingSyncRoom`.
2025-05-19 15:58:58 +02:00
Ivan Enderlin
52c38ec44d refactor(base): Remove SlidingSync::get_room.
This patch removes the `SlidingSync::get_room` method. The goal is to
remove `SlidingSyncRoom`.
2025-05-19 15:58:58 +02:00
Valere Fedronic
21de891ea5 feat(sdk): Add the encrypt_and_send_raw_to_device method
This method allows users to encrypt and send custom to-device events to a set of devices of their choosing.
matrix-sdk-ffi/20250521
2025-05-19 11:20:25 +00:00
Mauro
154f29e5a0 feat(sdk): implement and observe MSC4278 config value
This patch
- Updates Ruma to use the improved MediaPreviewConfig event type that
also supports a `Default` for the content type
- Implemented a way to observe the stable and unstable values of the
event and return the used one accordingly, if no one is present the
default will be used
- Set the value (will only use unstable type for now)
2025-05-19 12:35:50 +02:00
Ivan Enderlin
7f07731471 doc(changelog): Add #5054. 2025-05-19 11:42:09 +02:00
Ivan Enderlin
1a0a4d7905 chore(base): Remove RoomInfo::prev_room_state.
This patch removes the `RoomInfo::prev_room_state` field, along with the
`RoomInfo::prev_state` method.

This data was introduced during the knocking project but was never used,
and is not used nowadays. Let's remove it.
2025-05-19 11:42:09 +02:00
Jonas Platte
e3bcd4d5b2 chore: Upgrade dirs to 6.0 in examples 2025-05-19 09:23:02 +02:00
Timo
ea4c9a41f8 feat(widgets): Add the controlledMediaOutput url parameter to the VirtualElementCallWidgetOptions.
This is used to configure EC on devices that need to control media outputs on their own (android, ios).
If set, EC will display a list of devices provided by the app.
2025-05-16 15:48:49 +02:00
Ivan Enderlin
ac2c7f431c feat(ui): Add m.room.tombstone to the room list required_state.
This patch adds the `m.room.tombstone` state event to the list of
events in `required_state` used by the `RoomListService`. The goal is to
offer the possibility for the consumers to know whether a room has been
tombstoned or not.
2025-05-16 15:11:11 +02:00