Commit Graph

13223 Commits

Author SHA1 Message Date
Jonas Platte 5cf3c1e731 testing: Use EventBuilder in timeline teply integration tests 2023-09-21 16:00:11 +02:00
Jonas Platte 37912a1909 testing: Update EventBuilder method names for clarity 2023-09-21 16:00:11 +02:00
Jonas Platte c89b38b19f testing: Update EventBuilder::make_message_event_with_id argument order 2023-09-21 16:00:11 +02:00
Jonas Platte 2376f16214 testing: Change make_message_event_with_id to take event_id by reference 2023-09-21 16:00:11 +02:00
Jonas Platte 5d5f5e18de testing: Move ALICE, BOB, CAROL statics to test crate 2023-09-21 16:00:11 +02:00
Jonas Platte a5a9940ad9 testing: Extract EventBuilder out of TestTimeline 2023-09-21 16:00:11 +02:00
Jonas Platte fe2e60c60d testing: Replace TimelineTestEvent::Custom with sync_timeline_event! 2023-09-21 16:00:11 +02:00
Jonas Platte 054d26774c testing: Generalize add_timeline_event for sync response room builders 2023-09-21 16:00:11 +02:00
Jonas Platte c8a4bc799b testing: Add sync_timeline_event macro for more type safety in tests 2023-09-21 16:00:11 +02:00
Jonas Platte 82f793ec0f testing: Rename event_builder module to sync_builder
It used to contain a type named EventBuilder, but that has been renamed
to SyncResponseBuilder a while ago.
2023-09-21 16:00:11 +02:00
Ivan Enderlin cce8698e6e Merge pull request #2597 from Hywan/fix-base-poll-unstable-ruma-feature 2023-09-21 14:00:55 +02:00
Ivan Enderlin b495988424 fix(cargo): Move the unstable-msc3381 feature to matrix-sdk-base. 2023-09-21 13:19:10 +02:00
Ivan Enderlin 77d6c3144e Merge pull request #2581 from Hywan/feat-ffi-room-avatar-image-info 2023-09-21 12:24:02 +02:00
Ivan Enderlin 9f4b2bec05 fix(cargo): Enable unstable-msc3381 on ruma.
Without this feature:

```sh
$ cargo check -p matrix-sdk --features experimental-sliding-sync
    Checking matrix-sdk-base v0.6.1 (/Users/hwhost/Development/Element/matrix-rust-sdk/crates/matrix-sdk-base)
error[E0433]: failed to resolve: could not find `poll` in `events`
 --> crates/matrix-sdk-base/src/latest_event.rs:7:5
  |
7 |     poll::unstable_start::SyncUnstablePollStartEvent, room::message::SyncRoomMessageEvent,
  |     ^^^^ could not find `poll` in `events`

error[E0599]: no variant or associated item named `UnstablePollStart` found for enum `AnySyncMessageLikeEvent` in the current scope
  --> crates/matrix-sdk-base/src/latest_event.rs:40:68
   |
40 |         AnySyncTimelineEvent::MessageLike(AnySyncMessageLikeEvent::UnstablePollStart(poll)) => {
   |                                                                    ^^^^^^^^^^^^^^^^^ variant or associated item not found in `AnySyncMessageLikeEvent`
```

With the feature, everything goes well.
2023-09-21 11:41:02 +02:00
Ivan Enderlin 2ef05eb464 feat(sdk): Remove SlidingSyncList::room_list_filtered_stream
feat(sdk): Remove `SlidingSyncList::room_list_filtered_stream`
2023-09-21 10:31:20 +02:00
Ivan Enderlin 0989dd7fb7 feat(ui): Add the none filter
feat(ui): Add the `none` filter
2023-09-21 10:20:07 +02:00
Ivan Enderlin 3d8bdba268 feat(sdk): Remove SlidingSyncList::room_list_filtered_stream.
This patch removes `SlidingSyncList::room_list_filtered_stream.
Of course, the only place where it was used,
`RoomList::entries_with_dynamic_adapters` now use `.filter` from
`VectorSubscriberExt`. It's basically less code.
2023-09-21 10:17:06 +02:00
Ivan Enderlin 424135b831 fix(ffi): RoomListItem::full_room is now async
fix(ffi): `RoomListItem::full_room` is now `async`
2023-09-21 09:55:24 +02:00
Ivan Enderlin 7fc77a2d7e fix(ffi): RoomListItem::full_room is now async.
Because it creates a bug on iOS when using `RUNTIME.block_on` here.

This patch also adds `full_room_blocking` temporarily for Kotlin.
2023-09-21 09:35:16 +02:00
Ivan Enderlin ce2bac6818 feat(ffi): Add RoomListEntriesDynamicFilterKind::None. 2023-09-21 09:32:12 +02:00
Ivan Enderlin ef8c82113d test(ui): Test the none filter in real life. 2023-09-21 09:32:12 +02:00
Ivan Enderlin e91f170589 feat(ui): Add the none filter.
It's the opposite of the `all` filter. This one rejects all entries.
2023-09-21 09:32:12 +02:00
Ivan Enderlin 95e8f49afc test(ui): Test an empty pattern for filters. 2023-09-21 09:32:12 +02:00
Jonas Platte 1a15802201 Upgrade Ruma 2023-09-20 14:19:06 +02:00
Jonas Platte 784171e261 ffi: Don't check original sender of message when editing
The timeline checks this already. The network request made for this was
wasteful and unnecessary.
2023-09-20 11:57:38 +02:00
Marco Romano 9a0cc58e4a Support polls as latest event of a room 2023-09-20 09:45:25 +00:00
Ivan Enderlin 8217d18117 doc(ffi): Document media_info of Room::upload_avatar. 2023-09-20 10:32:47 +02:00
Ivan Enderlin a23d497d5c feat(ffi): Room::upload_avatar now has an Option<ImageInfo>.
This patch adds `Option<ImageInfo>` as an argument of
`Room::upload_avatar`.

To achieve that, this patch implements
`TryFrom<ImageInfo> for ruma::events::room::avatar::ImageInfo`.
2023-09-20 10:25:40 +02:00
Ivan Enderlin dfdc32f89a feat(ffi): Rename TimelineError to MediaInfoError.
The `TimelineError` type only contains error variants used for
`ImageInfo`, `AudioInfo`, `VideoInfo`, `FileInfo` and so on. It's never
used for something strictly related to the `Timeline`.

This patch then renames `TimelineError` to `MediaInfoError`.
The `MissingMediaInfoField` variant becomes `MediaField`. The
`InvalidMediaInfoField` becomes `InvalidField`.
2023-09-20 10:00:40 +02:00
Nicolas Mauri 31cb34f909 ffi: Add support for voice messages sent as m.room.message 2023-09-19 18:11:52 +00:00
Jonas Platte a37c487763 examples: Remove nonsensical room state check
Stripped state events are only received for rooms in invite state.
2023-09-19 17:57:39 +02:00
Damir Jelić eeb27adad2 Use the extracted ciphers for the file-based key export support 2023-09-19 15:23:46 +02:00
Damir Jelić 0c726d521b Add a new ciphers module for AES-CTR-256 with HMAC-SHA256
This module is mainly extracting logic we're already using for the
file-based key exporting.

Co-authored-by: Denis Kasak <dkasak@termina.org.uk>
2023-09-19 15:23:46 +02:00
Jonas Platte 13c9b0f803 ffi: Add _blocking versions of async methods in notification_settings 2023-09-19 12:13:42 +02:00
Jonas Platte 40f701986c ffi: Add _blocking versions of async methods in session_verification 2023-09-19 12:13:42 +02:00
Jonas Platte 7f2f3053f1 ffi: Add _blocking versions of async methods in sync_service 2023-09-19 12:13:42 +02:00
Jonas Platte 0ceb93a410 ffi: Add _blocking versions of async methods in room 2023-09-19 12:13:42 +02:00
Jonas Platte 52ce2eed23 Upgrade eyeball, eyeball-im-util
Pulls in an important bug fix for the Limit adapter.
2023-09-19 11:35:18 +02:00
Ivan Enderlin 1e80aae780 feat(ui): RoomList dynamic entries simplifications
feat(ui): `RoomList` dynamic entries simplifications
2023-09-19 11:00:35 +02:00
Ivan Enderlin af7cf3148b test(ui): Ensure that it's fine to reset_to_one_page multiple times. 2023-09-19 10:40:02 +02:00
Ivan Enderlin d0da4ae159 feat(ui): Update the limit if it's different.
Use `SharedObservable::set_if_not_eq` instead of `::set`, so that it
doesn't update the limit to the same value, which would be unnecesary in
this case.
2023-09-19 10:34:27 +02:00
Ivan Enderlin c2166c50b1 chore(ui): Remove a useless clone.
It was necessary before 0f7e5ba4b0, but it
isn't anymore.
2023-09-19 10:33:19 +02:00
Ivan Enderlin a1a5b85fd8 feat(ui): Remove one Mutex.
This patch removes the `Mutex` around `Subscriber<Option<u32>>` inside
the `RoomListDynamicEntriesController`. The `Mutex` was necessary to
get a mutable reference, so that `Subscriber::next_now` could have been
used. However, it's not necessary to use `new_now` in this particular
context. We can use `get` instead, which take an immutable reference,
thus removing the need for the `Mutex`.

A `Mutex` has a non-negligeable cost. This function can be used in a
critical hot path, and must as fast as possible.
2023-09-19 10:29:49 +02:00
Ivan Enderlin 12316ad281 feat(ui): Improve the InputCannotBeApplied displaying
feat(ui): Improve the `InputCannotBeApplied` displaying
2023-09-19 08:56:55 +02:00
Jonas Platte 97c5acff7c Use new functionality from eyeball-im-util 0.5 2023-09-18 19:56:06 +02:00
Jonas Platte 0504eafc0a Upgrade most dependencies 2023-09-18 19:56:06 +02:00
Jonas Platte beeeec34f7 sdk: Wait on sync beat asynchronously 2023-09-18 19:56:06 +02:00
Jonas Platte 45b7e075c9 Remove unused dependencies 2023-09-18 19:56:06 +02:00
Benjamin Bouvier 0ecdc2f43c fix(e2ee): query keys for untracked users even if we didn't explicitly sync members ourselves 2023-09-18 17:24:21 +02:00
Ivan Enderlin ae27164bb3 feat(ui): Improve the InputCannotBeApplied displaying. 2023-09-18 17:02:41 +02:00