Commit Graph

137 Commits

Author SHA1 Message Date
Johannes Marbach
ee06965d2e feat(timeline): Expose method to send galleries in matrix-sdk-ui (#5125)
This was broken out of
https://github.com/matrix-org/matrix-rust-sdk/pull/4838 and is a step
towards implementing
https://github.com/matrix-org/matrix-spec-proposals/pull/4274. Building
upon https://github.com/matrix-org/matrix-rust-sdk/pull/4977, a new
method `Timeline::send_gallery` in matrix-sdk-ui for sending galleries.

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

---------

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-06-03 15:24:02 +02:00
Yousef Moazzam
a099879563 test: add reply thread relation method to sticker event builder 2025-06-03 13:19:34 +02:00
Yousef Moazzam
b6569762db test: add sticker event method to EventFactory 2025-06-03 13:19:34 +02:00
Daniel Salinas
c6e55c1a36 Mechanical move from target_arch="wasm32" to target_family="wasm" 2025-06-02 17:27:34 +02:00
Benjamin Bouvier
f2a90cb921 test: use helpers to create a bundled edit and thread summary 2025-06-02 16:24:25 +02:00
Robin
2c8e71e560 refactor(tests): Allow converting EventBuilder to state 2025-05-30 15:32:35 +02:00
Robin
6f683d3cde refactor(tests): Accept more types for sync builder state events
Refactoring the test event implementation to use the From trait rather than ad-hoc methods along the way.
2025-05-30 15:32:35 +02:00
Jonas Platte
3c20ee41d6 chore: Fix clippy lints 2025-05-29 10:59:56 +02:00
Ivan Enderlin
bfac815a5e test: EventBuilder<RoomCreateEventContent> can set predecessor.
This patch adds the `predecessor` and `no_predecessor` methods on
`EventBuilder<RoomCreateEventContent>`. This is helpful to configure the
`predecessor` field.
2025-05-23 11:35:53 +02:00
Ivan Enderlin
95e8d0589b test: Fix EventFactory::create.
This patch fixes `EventFactory::create` where the `m.room.create` wasn't
created as a state-event (the `state_key` field was missing).

Also, it uses the `creator_user_id` in the `sender` field if no sender
was given.
2025-05-23 11:35:53 +02:00
Ivan Enderlin
16a923edda test: Simplify EventBuilder::into_raw_timeline.
This patch simplifies `EventBuilder::into_raw_timeline`. It is exactly
like `EventBuilder::into_raw`, so let's use it.
2025-05-23 11:35:53 +02:00
Ivan Enderlin
9c227c2321 feat(base): Add Room::successor_room and Room::predecessor_room.
First off, this patch renames `Room::tombstone` to
`Room::tombstone_content` (to be consistent with other methods, such as
`Room::create_content`).

Second, this patch adds the `Room::successor_room` and
`Room::predecessor_room` methods, along with the `SuccessorRoom` and
`PredecessorRoom` types. This naming more or less comes from the Matrix
specification:

- the term _predecessor_ is part of the specification,
- the term _successor_ isn't present _per se_, the words _replacement
  room_ are used instead, but I prefer _successor_ as it brings a nice
  symmetry with _predecessor_.
2025-05-23 11:35:53 +02:00
Timo
6d5ad4eddc feat(widget-driver): Add to-device support
The widget Driver should be able to send and receive to-device events.
This is useful for element call encryption keys.

This PR focusses on the widget driver and machine logic. To
send/communicate the events from the widget to the driver.

It skips any encryption logic. Some of the encryption logic will be part
of crypto crate and the code in the widget driver crate should be kept
minimal once the crypto crate is ready.

---------

Co-authored-by: Valere <bill.carson@valrsoft.com>
2025-05-22 13:38:28 +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
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
Stefan Ceriu
da2dda0e45 fix(ui): populate the thread_root and in_reply_to fields for stickers and polls
They have never been set and there was no way of telling if stickers and polls belong on a thread or come in reply of any other message.

This patch also exposes methods for setting these relations on the event factory level.
2025-05-15 16:45:34 +03:00
Yousef Moazzam
cabe9632af test: add room canonical alias event method to EventFactory 2025-05-13 09:04:55 +02:00
Yousef Moazzam
f1ea47f0b6 test: add room server ACL event method to EventFactory 2025-05-12 09:30:36 +02:00
Yousef Moazzam
4053321cd0 test: add room power levels event method to EventFactory 2025-05-10 20:35:57 +02:00
Yousef Moazzam
93dcd07073 test: add room create event method to EventFactory 2025-05-09 11:51:45 +02:00
Benjamin Bouvier
404dd3949f test: remove unused helpers 2025-03-26 11:01:14 +01:00
Benjamin Bouvier
693c8df8d0 test(timeline): more of the same, with a new EventFactory method to add a receipt with a given timestamp 2025-03-26 11:01:14 +01:00
Benjamin Bouvier
be6daa5930 test: add EventFactory::typing for typing notifications and get rid of more old cruft 2025-03-26 11:01:14 +01:00
Benjamin Bouvier
acee5415c5 test: get rid of a few global statics for read receipts event contents 2025-03-26 11:01:14 +01:00
Benjamin Bouvier
b5aa2113db test: add a way to create ephemeral read receipts events in the EventFactory 2025-03-26 11:01:14 +01:00
Stefan Ceriu
78282bf1e1 chore(sdk-base): fix typos following typos crate bump to 1.30.0 2025-03-04 11:28:36 +02:00
Benjamin Bouvier
a5f0473e1b test(timeline): use the MatrixMockServer and EventFactory in integration/timeline/mod.rs 2025-02-11 11:26:47 +01:00
Ivan Enderlin
7eae832b8c test: set_timeline_prev_batch takes anything that implements Into<String>. 2025-02-04 19:43:38 +01:00
Benjamin Bouvier
041627ec4a test: rename EventFactory::into_sync to into_event 2025-01-22 20:24:48 +01:00
Benjamin Bouvier
3428494468 refactor: rename SyncTimelineEvent to TimelineEvent 2025-01-22 20:24:48 +01:00
Benjamin Bouvier
eb31f035e6 refactor: turn TimelineEvent into SyncTimelineEvent
As the comment noted, they're essentially doing the same thing. A
`TimelineEvent` may not have computed push actions, and in that regard
it seemed more correct than `SyncTimelineEvent`, so another commit will
make the field optional.
2025-01-22 20:24:48 +01:00
Benjamin Bouvier
4341aaf65c test: remove some uses of sync_timeline_event! in the base and sdk crates (#4565)
Part of #3716.
2025-01-21 14:33:22 +00:00
Benjamin Bouvier
210c5749f1 test: minimize usage of EventFactory::state_key
It was used in places where we could make use of other helpers, in some
cases. Also introduces the `room_avatar` helper to create the room
avatar state event.
2025-01-21 10:50:29 +01:00
Benjamin Bouvier
0c74abbc50 test: get rid of EventBuilder (#4560)
This gets rid of `EventBuilder`, and makes more usage of the
`EventFactory`, which is more ergonomic to create test events.

A large part of
https://github.com/matrix-org/matrix-rust-sdk/issues/3716.
2025-01-21 09:23:03 +00:00
Richard van der Hoff
f231c74314 test: simplify examples for KeyQueryResponseTemplate
Generating keys from slices rather than base64 is easier.

Also, s/builder/template/.
2025-01-16 15:13:11 +00:00
Richard van der Hoff
c24770a774 test: add support for dehydrated devices to KeyQueryResponseTemplate (#4540)
#4476 added some test helpers to generate `/keys/query` responses. We're
going to need to test dehydrated devices, so this PR adds support for
that.
2025-01-16 11:26:52 +00:00
Richard van der Hoff
3dd81fbe2c test: rename snapshots not to contain :
Windows doens't allow you to have `:` in its filenames
2025-01-16 11:11:38 +00:00
Benjamin Bouvier
560e582e41 test: get rid of mock_redaction and replace it with the holy MatrixMockServer 2025-01-16 11:34:42 +01:00
Richard van der Hoff
fe3cc09ae0 test: add examples for the new builder 2025-01-15 10:42:21 +00:00
Richard van der Hoff
3a3cc54067 test: generate dan's data dynamically 2025-01-15 10:42:21 +00:00
Richard van der Hoff
47f8b32ea1 test: give Dan new keys
Regenerate Dan's data with new cross-signing and device keys, for which I know
the private keys.

The signatures are manually calculated for now; this will be improved in a
later commit.
2025-01-15 10:42:21 +00:00
Richard van der Hoff
49748dbd4b test: factor out common parts of dan_keys_query_response{_loggedout} 2025-01-15 10:42:21 +00:00
Richard van der Hoff
25ea5fdd73 test: use builder for some more test data 2025-01-15 10:42:21 +00:00
Richard van der Hoff
5fadde5a6d test: implement test user data builder type
... and use it for some simple data
2025-01-15 10:42:21 +00:00
Richard van der Hoff
b6be4d5170 test: remove redundant sig on master key
Our test helper won't do this, and it's redundant
2025-01-15 10:42:21 +00:00
Richard van der Hoff
c9bac4ff2b test: snapshot the generated object rather than the JSON
We're going to be switching away from JSON-twiddling, so let's snapshot the
real object rather than the JSON.
2025-01-15 10:42:21 +00:00
Richard van der Hoff
fedf7d214f test: add some snapshot tests before we change anything 2025-01-15 10:42:21 +00:00
Benjamin Bouvier
aca8c8b8ee chore: remove some allow(dead_code) annotations and associated dead code (#4472)
We have quite a few `allow(dead_code)` annotations. While it's OK to use
in situations where the Cargo-feature combination explodes and makes it
hard to reason about when something is actually used or not, in other
situations it can be avoided, and show actual, dead code.
2025-01-08 10:37:18 +01:00
Damir Jelić
6501a44e6a feat: Add support for MSC4171
Introduce support for MSC4171, enabling the designation of certain users
as service members. These flagged users are excluded from the room
display name calculation.

MSC: https://github.com/matrix-org/matrix-spec-proposals/pull/4171
2024-12-05 14:23:36 +01:00
Valere
6801811226 feat(crypto): Supports new UtdCause variants for withheld keys
Adds new UtdCause variants for withheld keys, enabling applications to display customised messages when an Unable-To-Decrypt message is expected.

refactor(crypto): Move WithheldCode from crypto to common crate
2024-12-04 15:33:23 +01:00