Commit Graph

13223 Commits

Author SHA1 Message Date
Jorge Martín 769a627496 ci: try fixing the kotlin bindings tests by using NDK 27 2024-08-02 17:28:36 +02:00
Timo aff7aefd28 WidgetDriver: don't specify the length of the serializer. Its not needed for the json serializer. 2024-08-02 15:14:09 +01:00
Timo d60b9d3da2 Changelog: Add delayed event to the widget driver.
Also mention the breaking change in the public widget capabilities interface.
2024-08-02 15:14:09 +01:00
Timo 8d5dc18dd3 IntegrationTests: Add integration tests for the WidgetDriver delayed events. 2024-08-02 15:14:09 +01:00
Timo 49790c9f91 WidgetDriver: wire up everything in the widget process action handler. 2024-08-02 15:14:09 +01:00
Timo 2e8b135859 WidgetDriver: Add interacting with delayed event to the matrix driver.
In `matrix.rs` we add methods to interact with the matrix homeserver. And in `machine/mod.rs` we implement the widgetMachine cases for handling (checking capabilities and using the matrixDriver) delayed events.
2024-08-02 15:14:09 +01:00
Timo 7614bfb716 WidgetDriver: Introduce new capabilities for sending and updating delayed events.
Those capabilities are also exposed to the FFI.
+ related tests
2024-08-02 15:14:09 +01:00
Timo 0407dd7eb1 WidgetDriver: Introduce new Delay Event update widget action types.
Also update the naming from `future` to `delay` in existing types.
2024-08-02 15:14:09 +01:00
Timo 16a638400c chore: Update ruma to a version supporting authenticated delayed events. 2024-08-02 15:14:09 +01:00
torrybr be6bc444f8 chore: fix formatting 2024-08-02 15:42:54 +03:00
torrybr 36091a9ef3 sdk: refactor beacon_info tests into their own folder 2024-08-02 15:42:54 +03:00
Stefan Ceriu 1160383d71 sdk: fix identity reset not actually disabling backups when not enabled locally, resulting in conflicts and failing to correctly setup the newly reset session 2024-08-02 15:25:42 +03:00
Stefan Ceriu d7f3914673 sdk: throw an error instead of silently failing when disabling backups if they weren't previously enabled locally
- also change back the state from `disabling` to `unknown`
2024-08-02 15:25:42 +03:00
Jorge Martín 1ca4377baf ffi: add FFI bindings for creating the new pinned events focused timeline 2024-08-02 13:11:24 +02:00
Jorge Martín ab12f2f7ca sdk-ui: add and fix tests 2024-08-02 13:11:24 +02:00
Jorge Martín 6889430474 benchmark: add a benchmark to measure how loading pinned events performs 2024-08-02 13:11:24 +02:00
Jorge Martín 382c573973 sdk-ui: add TimelineFocus::PinnedEvents and TimelineFocusData::PinnedEvents to load the live pinned events for a room.
Add `PinnedEventsLoader` to encapsulate this logic, being able to provide a max number of events to load and how many can be loaded at the same time. Also implement an event cache for it.

 Add `PinnedEventsRoom` trait to use it in the same way as `PaginableRoom`, only for pinned events.
2024-08-02 13:11:24 +02:00
Jorge Martín 643c9a0b8e sdb-base: add methods for getting the pinned event ids of a Room as a stream and checking whether an event is pinned in the room or not 2024-08-02 13:11:24 +02:00
Kévin Commaille 689bf9b4dc base-sdk: Properly update direct targets of rooms with m.direct event
The code used to only add new targets to rooms
but never remove the ones that are not in the event anymore.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-08-02 12:46:37 +02:00
Richard van der Hoff 21efd60dba crypto: clarify/expand comments in Device::is_owner_of_session
I found some of this comment a bit hard to grok, so I've expanded it a
bit. Hope it's clear to others.
2024-08-02 10:04:08 +02:00
Valere 0850c0c1c9 feat(crypto): Add support for master key local pinning (#3639)
This patch ensures that we retain the master key for a given UserIdentityData object, even when a new and different identity arrives via the `/keys/query` endpoint. This concept, called pinning, is similar to certificate pinning in web browsers.

Retaining the master key allows us to detect changes and notify the user accordingly.
2024-08-02 09:13:14 +02:00
Doug aee8728418 sdk-ui: Fix a bug where local echoes were showing unencrypted shields. 2024-08-01 14:28:33 +03:00
Kevin Boos 7c5c5a8f30 timeline: re-export ReactionsByKeyBySender and ReactionInfo types (#3787)
This tiny change allows one to easily name the return type of
`EventTimelineItem::reactions()` such that you can use it in a function
signature. Same goes for the `ReactionInfo` type.

I think this was likely just a small oversight in recent changes to the
reactions API, so hopefully it's not controversial.

Without this, it's impossible to write a function that uses
`ReactionsByKeyBySender` or `ReactionInfo` in the signature.

Signed-off-by: Kevin Boos <kevinaboos@gmail.com>
2024-08-01 11:37:16 +01:00
Stefan Ceriu bfa069d6c0 Merge pull request #3783 from matrix-org/doug/sent-in-clear
UI Timeline: Build a ShieldState for an unencrypted event in an encrypted room.
2024-08-01 11:47:52 +03:00
Doug de502f42c6 chore: Add docs & todo on EventTimelineItem::from_latest_event 2024-07-31 19:08:31 +01:00
Doug dc1a34cd56 chore: Fix tests. 2024-07-31 15:51:40 +01:00
Doug 11a26d7fc4 chore: Make the room encryption state optional on timeline items. 2024-07-31 14:45:00 +01:00
Doug 1abbaa8607 ui: Add tests for Sent In Clear shield. 2024-07-31 13:06:36 +01:00
Doug bae0f304f7 ui: Add a ShieldState for "Sent in clear". 2024-07-31 13:06:36 +01:00
Andy Balaam 25df9a11c5 crypto: Rename OlmMachine::get_or_update_verification_state 2024-07-31 12:27:30 +01:00
Andy Balaam 1f937278b2 crypto: Store the updated SenderData in the store when we calculate it 2024-07-31 12:27:30 +01:00
Andy Balaam e2ff2daf5d crypto: Extract a function to convert SenderData->VerificationState 2024-07-31 12:27:30 +01:00
Damir Jelić 8760ea8440 chore: Update the bytemuck crate 2024-07-31 10:40:23 +02:00
Andy Balaam d03d3cff17 crypto: Remove unused retry_details from SenderData 2024-07-30 14:34:23 +01:00
Andy Balaam f88c6dff4d crypto: Use SenderDataFinder to implement get_verification_state
This avoids repeating equivalent code.
2024-07-30 13:50:58 +01:00
Andy Balaam d3835bb992 crypto: Return an error if is_owner_of_session fails 2024-07-30 13:50:58 +01:00
Andy Balaam 93a0fe500b crypto: Provide specific error types for SenderDataFinder 2024-07-30 13:50:58 +01:00
Andy Balaam 1f369c5912 crypto: Support a mismatched identity variant in session creation errors 2024-07-30 13:50:58 +01:00
Andy Balaam 2289c813f1 crypto: Allow testing SenderDataFinder with imported sessions 2024-07-30 13:50:58 +01:00
Andy Balaam 0a9431d01d crypto: Do not provide device ID to EncryptionInfo when device is not the owner 2024-07-30 13:50:58 +01:00
Stefan Ceriu f51eebb55f Merge pull request #3759 from matrix-org/stefan/crypto-identity-reset
ffi: add high level method for resetting the user's identity and deleting all associated secrets
2024-07-30 13:29:01 +03:00
Stefan Ceriu 8895e532bb Handle the situation where the backend skips user interactive authentication
- disable backups and recovery before requesting the reset handle
- attempt device key upload
- re-enable backups both when UIAA is required and when not
2024-07-30 13:13:26 +03:00
Richard van der Hoff 40e3a96ae3 Make message-ids feature the default (#3776)
The feature is now a no-op.

Will fix (I hope)
https://github.com/element-hq/element-android/issues/8872
2024-07-30 10:49:21 +01:00
Stefan Ceriu 8fe2b37354 ffi: Expose identity reset mechanism 2024-07-29 16:52:03 +03:00
Stefan Ceriu db064626fa sdk: Add high level method for resetting the user's identity and deleting all associated secrets 2024-07-29 16:52:03 +03:00
Andy Balaam 0b46a7e29c crypto: Make the return type of is_owner_of_session more specific 2024-07-29 14:50:22 +01:00
Andy Balaam 449e8b40b8 crypto: Extract a new error type: MismatchedIdentityKeysError 2024-07-29 14:50:22 +01:00
Andy Balaam d7224a7ede crypto: Store device_id in SenderData
This means we have all the information inside SenderData to populate
VerificationStatus and DeviceId for EncryptionInfo, so we can share the
code between SenderDataFinder and get_verification_state.
2024-07-29 11:11:44 +01:00
Jorge Martin Espinosa e0833110f2 Merge pull request #3771 from torrybr/feat/send-beacon
sdk: basic support for sending location beacons
2024-07-29 09:47:55 +02:00
torrybr 3756eeb385 test: move beacon tests into own file 2024-07-26 23:55:19 -04:00