Commit Graph

6287 Commits

Author SHA1 Message Date
Jonas Platte
daf59356cb ffi: Remove room list from UDL 2023-06-15 15:20:46 +02:00
Jonas Platte
53ae4362f6 ffi: Remove unused public Rust API 2023-06-15 15:20:46 +02:00
Jonas Platte
b789b9e063 ffi: Remove room / timeline things from UDL 2023-06-15 15:20:46 +02:00
Jonas Platte
b1c8859eb9 Upgrade UniFFI 2023-06-15 15:20:46 +02:00
Jonas Platte
0e618bea5c ui: Don't use TryFutureExt where not necessary 2023-06-15 14:37:40 +02:00
Ivan Enderlin
31d834048f feat(fii): Implement RoomList::apply_input
feat(fii): Implement `RoomList::apply_input`
2023-06-15 13:22:09 +02:00
Benjamin Bouvier
1fd039c64f sliding sync: lazily generate and include the transaction id, only if it's useful (#2063)
* feat: lazily generate and include the transaction id, only if it's useful
* chore: add a small `LazyTransactionId` wrapper that ensures it's only created once

---------

Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-06-15 10:30:24 +00:00
Kévin Commaille
16a63d352c base: Remove the session field from StateChanges
It is never set nor used.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-15 11:12:40 +02:00
Ivan Enderlin
59565657fa feat(ffi): Implement RoomList::apply_input.
This patch implements `RoomList::apply_input`. Usage example:

```rust
room_list.apply_input(RoomListInput::Viewport { ranges: vec![RoomListRange { start: 10, end_inclusive: 20 }]}).await?;
```
2023-06-15 11:12:17 +02:00
Ivan Enderlin
ea9a85395a chore(ui): Add missing trailing commas. 2023-06-15 11:11:48 +02:00
Jonas Platte
78135fcce9 ffi: Add message_event_content_new 2023-06-15 10:44:40 +02:00
Jonas Platte
7feba6f814 ffi: Use Duration instead of u64
Resolves FIXME comment.
2023-06-15 10:44:40 +02:00
Ivan Enderlin
7756b6d725 feat(ui): Implement room subscriptions in RoomList + notification counts
feat(ui): Implement room subscriptions in `RoomList` + notification counts
2023-06-15 10:28:04 +02:00
Ivan Enderlin
c07bb0ec39 test(ui): Test that RoomList receives State updates even if the same.
`RoomList::state` provides a `Subscriber` to the `State`. This patch
modifies the way the state is tested, to ensure that there is always
an update broadcasted even if the state is the same (e.g. if the state
moves from `CarryOn` to `CarryOn`).
2023-06-15 09:55:57 +02:00
Ivan Enderlin
ddffa00589 test(ui): Test Room::*unread_notifications(). 2023-06-15 09:40:55 +02:00
Ivan Enderlin
6e1de8a5ee fix(ffi): RoomListItem::full_room returns a Room with a Timeline. 2023-06-15 09:26:33 +02:00
Ivan Enderlin
23d5655901 feat(ui): room_list::RoomInner holds Arc to Timeline.
This patch updates `RoomInner::timeline` and `::sneaky_timeline` to
`AsyncOnceCell<Arc<Timeline>>`. Adding `Arc` allows to copy the timeline
if necessary more easily.
2023-06-15 09:24:47 +02:00
Richard van der Hoff
6b45749e17 crypto-js: Add new methods to VerificationRequest (#2068)
A couple of useful methods for accessing things in `VerificationRequest`.
2023-06-14 15:46:36 +01:00
Jonas Platte
b4cd0c71bf ui: Add loading indicator before waiting for prev_batch token
… in Timeline::paginate_backwards.
2023-06-14 14:00:58 +02:00
Kévin Commaille
b4fdfee7f0 base: Use batch methods in Room::get_members
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-14 13:51:52 +02:00
Kévin Commaille
38fc1f7b15 base: Add method to construct RoomMember from parts
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-14 13:51:52 +02:00
Kévin Commaille
e32e9b5a22 base: Add state store method to fetch several display_names at once
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-14 13:51:52 +02:00
Kévin Commaille
7cba6d0849 base: Add state store method to fetch several presence events at once
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-14 13:51:52 +02:00
Kévin Commaille
b8abd1c022 base: Add state store method to fetch several profiles at once
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-14 13:51:52 +02:00
Kévin Commaille
4103d1b3e3 sdk: Add room method to fetch several state events at once
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-14 13:51:52 +02:00
Kévin Commaille
f740195eb6 base: Add state store method to fetch several state events at once
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-14 13:51:52 +02:00
Jonas Platte
ae4ead5550 Upgrade typos CI action
… and update the config file to reduce check flakiness.
2023-06-14 12:31:32 +02:00
Jonas Platte
820d3aff65 Rewrap base64 test strings 2023-06-14 12:31:32 +02:00
Jonas Platte
b3017a1073 Fix typos 2023-06-14 12:31:32 +02:00
Ivan Enderlin
b9c27b5c63 feat(ui): Implement Room::*unread_notifications. 2023-06-14 12:15:16 +02:00
Ivan Enderlin
1bc455f75b feat(ffi): Room:add_timeline_listener returns a …Result.
This patch updates `Room::add_timeline_listener` to return a `RoomTimelineListenerResult`, a new type defined as:

```rust
pub RoomTimelineListenerResult {
    items: Vec<Arc<TimelineItem>>,
    items_stream: TaskHandle,
}
```

It is not possible to cancel the `items_stream` by cancelling the
`TaskHandle`. Without this, dropping `Room` won't drop the `Timeline`,
as a clone is moved inside the spawned task. As a consequence, it will
endlessly call the listener.
2023-06-14 11:56:07 +02:00
Ivan Enderlin
97e4a5cab0 chore(ffi): Remove RoomListItem::timeline.
What the FFI user wants is to subscribe a listener to the
timeline updates. This feature is already supported by
`room_item.full_room().add_timeline_listener()`.  So we can safely
remove `RoomListItem::timeline` as we are sure it's never going to be
used for now.
2023-06-14 11:13:06 +02:00
Ivan Enderlin
192b9ce808 feat(ui+ffi): Implement Room::id as a shortcut.
It's possible to do `room.inner_room().room_id()` but it's just simpler
to call `room.id()`. This patch adds this shortcut.

It's especially useful for FFI users, where creating a “full
room” (`room_item.full_room().room_id()`) may be expensive.
2023-06-14 10:59:03 +02:00
Ivan Enderlin
dba397d470 feat(ffi): Add RoomListItem::subscribe and ::unsubscribe. 2023-06-14 10:56:59 +02:00
Ivan Enderlin
712b395310 feat(ui): Add Room::subscribe and ::unsubscribe.
This patch adds the `subscribe` and `unsubscribe` method on `Room`.

To achieve that, `Room` receives an `Arc<SlidingSync>`, as the
subscription methods are on `SlidingSync`. It's just easier to put them
on `Room` for the API consumer. It makes the API also more elegant.

Finally, the patch adds the appropriate test.
2023-06-14 10:51:37 +02:00
Kévin Commaille
eb5af4287f sdk: Allow to get rooms filtered by room state
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-14 10:45:37 +02:00
Kévin Commaille
c978fa6d40 base: Deprecate BaseClient::get_stripped_rooms
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-14 10:45:37 +02:00
Kévin Commaille
ac8ea4786c base: Deprecate StateStore::get_stripped_room_infos
It is now unused.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-14 10:45:37 +02:00
Kévin Commaille
281870b33f base: Remove stripped rooms list from Store
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-14 10:45:37 +02:00
Kévin Commaille
bcd7e92a94 base: Allow to get rooms filtered by state
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-14 10:45:37 +02:00
Kévin Commaille
ea219d836e base: Do not separate stripped room info
Since stripped and non-stripped room infos use the same types,
the separation is not necessary anymore.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-14 10:45:37 +02:00
Damir Jelić
f67c592259 Properly support the hkdf-hmac-sha256.v2 MAC method for the SAS verification (#2064) 2023-06-14 10:17:22 +02:00
Ivan Enderlin
0db5a6a25d Merge branch 'main' into pr/2058 2023-06-14 09:55:31 +02:00
Ivan Enderlin
2c871807a3 feat(ui+ffi): Add various features to RoomList
feat(ui+ffi): Add various features to `RoomList`
2023-06-14 09:22:24 +02:00
Ivan Enderlin
f55c1021c4 Merge pull request #2065 from matrix-org/rav/fix-docs
crypto-js: improvements to the documentation
2023-06-14 08:35:59 +02:00
Richard van der Hoff
f78a2951e4 more doc fixes 2023-06-13 22:10:48 +01:00
Richard van der Hoff
a8468cba59 crypto-js: improvements to the documentation
... mostly, writing down what things actually return.
2023-06-13 21:54:19 +01:00
Damir Jelić
48a24a6aed Use the short auth strings from the start content when accepting a verification (#2061)
Co-authored-by: Benjamin Bouvier <public@benj.me>
2023-06-13 17:33:57 +00:00
Benjamin Bouvier
a79d519ff9 sliding sync: always fall back to the auto-discovered proxy URL, if any
Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-06-13 19:33:30 +02:00
Jonas Platte
47a67d1d67 Upgrade Ruma 2023-06-13 18:33:28 +02:00