Commit graph

490 commits

Author SHA1 Message Date
Jorge Martin Espinosa
2206e940bc
Fix verification failed issue, simplify verification logic (#3830)
* Simplify session verification:

- Reuse Rust `Client` instances created on the login process so we don't need to restore one right before the session verification.
- Remove unnecessary sources of verification state updates.
- Add an intermediate FTUE flow step which will display an indeterminate progress indicator instead of a blank screen.

* Remove unnecessary workaround: the SDK should already handle this

* Add regression tests for noop analytics service usage.

* Add `services.analytics.noop` module to the test dependencies

---------

Co-authored-by: Benoit Marty <benoit@matrix.org>
2024-11-08 16:42:27 +01:00
ganfra
4620bb8704
Merge pull request #3809 from element-hq/renovate/org.matrix.rustcomponents-sdk-android-0.x
fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v0.2.59
2024-11-06 17:25:27 +01:00
ganfra
cc4a8d47eb rust sdk : handle api breaks for 0.2.59 2024-11-06 16:31:25 +01:00
Benoit Marty
223eae9602 Send caption with media 2024-11-04 14:24:39 +01:00
Benoit Marty
4b98ee92e3 Improve FakeMatrixRoom to be able to check all the parameters. 2024-10-30 18:39:55 +01:00
Benoit Marty
b8b38208f4 Incoming session verification request
Add more log to the state machines
Ensure the block cannot be cancelled, else if the Rust SDK emit a new state during the API execution, the state machine may cancel the api call.
Let VerificationFlowState values match the SDK api for code clarity.
Rename sub interface for clarity.
Migrate tests to the new FakeVerificationService.
2024-10-29 09:26:15 +01:00
ganfra
98057c1c39
Merge pull request #3725 from element-hq/feature/fga/knock_request_to_join
Feature: knock request to join
2024-10-23 18:50:32 +02:00
ganfra
5cce2ff572 knock : improve a bit code and add tests. 2024-10-23 15:44:00 +02:00
ganfra
ed5454bbb3 knock : add knock function to the matrix client 2024-10-22 16:22:19 +02:00
ganfra
73a46dcfc7 knock : use PendingRoom instead of InvitedRoom 2024-10-22 16:22:19 +02:00
Benoit Marty
5378c4efad Verified user badge.
Add disable action to verify user.
2024-10-22 14:09:35 +02:00
Benoit Marty
1f8f1c998f Fix API Break: introduce EventOrTransactionId 2024-10-18 08:49:11 +02:00
Benoit Marty
0db54df877 Restore fun interface for a sweeter code. 2024-10-16 17:12:46 +02:00
Benoit Marty
70c643be5e Remove unused isLocal field. 2024-10-16 16:19:04 +02:00
Benoit Marty
28d9da6d62 Fix other API change: EventShieldsProvider and EventTimelineItemDebugInfoProvider have been replaced by LazyTimelineItemProvider 2024-10-16 16:10:16 +02:00
Benoit Marty
c1c9f53015 Fix other API change: body renamed to filename 2024-10-16 16:09:32 +02:00
Benoit Marty
6a1ef6d6f7 Fix API update regrading OidcPrompt. 2024-10-16 14:58:04 +02:00
Benoit Marty
7ece687740
Merge pull request #3574 from element-hq/feature/bma/improveMediaModel
Clarify model for Event with attachment
2024-10-16 14:57:05 +02:00
Benoit Marty
03fd7afdd1 AcceptDeclineInviteState: create ConfirmingDeclineInvite to host InviteData when confirming decline of invite. 2024-10-14 11:19:18 +02:00
ganfra
a3db4b2043
Merge pull request #3631 from element-hq/feature/fga/rework_room_summary
Rework room summary
2024-10-09 11:44:45 +02:00
ganfra
348c84b8b9 misc : rework getRoomInfoFlow (by using getRoomSummaryFlow) 2024-10-08 21:36:38 +02:00
ganfra
eeb6b6f4bf misc : remove direct usage of RoomSummary in UI and let RoomSummary use RoomInfo. 2024-10-08 21:34:34 +02:00
Benoit Marty
ef4aa8f91e Do not render pin violation in clear room. 2024-10-08 18:30:08 +02:00
Benoit Marty
920dc2b0d7 Improve mapping regarding filename, caption and formattedCaption 2024-10-08 17:12:48 +02:00
Benoit Marty
d9fb0cf656 Pin user identity. 2024-10-07 22:19:13 +02:00
Benoit Marty
c69e5f47e5 Render PinViolation above the composer. 2024-10-07 22:18:32 +02:00
renovate[bot]
3001efb525
Update dependency org.matrix.rustcomponents:sdk-android to v0.2.50 (#3565)
* Adapt to changes in the SDK

* Update dependency org.matrix.rustcomponents:sdk-android to v0.2.50

* Use lambda instead of overriding the `EventDebugInfoProvider` interface

* Fix test proposal.
We may find a better way to compare data class instance if we need to do more comparison in the future...

---------

Co-authored-by: Jorge Martín <jorgem@element.io>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2024-10-01 09:44:52 +02:00
Benoit Marty
6fc801ede6 Use aNotificationData and aNotifiableMessageEvent
And cleanup existing tests.
2024-09-20 12:38:49 +02:00
Benoit Marty
6fa585f4c8 Add unit test on RustNotificationService
And fix mapping error.
2024-09-19 19:43:40 +02:00
Benoit Marty
0e90e57444 Add test skeleton for RustMatrixClientFactory and RustMatrixAuthenticationService 2024-09-19 12:16:24 +02:00
Benoit Marty
97f0b65c03 Change type of items in activeRoomCallParticipants from String to UserId 2024-09-18 17:16:06 +02:00
Benoit Marty
7903223585 Change type of items in alternativeAliases from String to RoomAlias 2024-09-18 17:16:06 +02:00
Benoit Marty
b87bec6228 Account deactivation. 2024-09-17 16:51:11 +02:00
Benoit Marty
cf2c90ea0a
Merge pull request #3467 from element-hq/feature/bma/accountCreation
Temporary account creation using Element Web.
2024-09-16 16:52:26 +02:00
ganfra
47d0c505b5
Merge pull request #3461 from element-hq/feature/fga/send_failure_identity_changes
Require acknowledgement to send to a verified user if their identity changed or if a device is unverified.
2024-09-16 16:00:18 +02:00
Jorge Martin Espinosa
7238af7f7f
Fix not being able to decline an invite from the room list (#3466)
* Add `InvitedRoom` to wrap Rust SDK Rooms in 'invited' membership state.

At the moment, this is a wrapper that allows us to call `Room.leave()` without having to initialise the room's timeline (which is impossible).

* Add `MatrixRoom.getInvitedRoom(roomId)` to get one of these rooms.

Also, `RustRoomFactory` now has a `createInvitedRoom` method for this.

* Adapt `AcceptDeclineInvitePresenter` to use the new APIs.
2024-09-16 13:02:20 +00:00
Benoit Marty
39348d2e7e Account Creation using a WebView 2024-09-16 12:24:47 +02:00
Jorge Martin Espinosa
663362ac7f
Add forced logout flow when the proxy is no longer available (#3458)
* Add `MatrixClient.isSlidingSyncProxySupported` function

* Update localazy strings

* Modify `ErrorDialog` to have an `onSubmit` call, which will be used for the submit action.

Also make the title text optional and dismissing the dialog by tapping outside/going back configurable.

* Check if a forced migration to SSS is needed because the proxy is no longer available.

In that case, display the non-dismissable dialog and force the user to log out after enabling SSS.

* Enable native/simplified sliding sync by default.

* Refactor the login to make sure we:

1. Always try native/simplified sliding sync login first, if available.
2. Then, if it wasn't available or failed with an sliding sync not supported error, try with the proxy instead (either discovered proxy or forced custom one).

* Move logic to `LoggedInPresenter` and the UI to `LoggedInView`

* Update screenshots

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2024-09-16 09:13:02 +00:00
ganfra
ff368b4072 Send failure verified user : resolve ui and logic 2024-09-13 16:40:07 +02:00
ganfra
de933b1f34 Send failure verified user : expose new methods on MatrixRoom. 2024-09-13 16:40:06 +02:00
Benoit Marty
f87422a022 Fix filtering of Event at the beginning of DM. 2024-09-12 09:21:53 +02:00
Benoit Marty
5a8658253a
Merge pull request #3442 from element-hq/feature/bma/deviceId
DeviceId and cleanup.
2024-09-11 11:01:31 +02:00
Benoit Marty
88b0eff0fe Introduce value class "DeviceId" 2024-09-11 09:52:25 +02:00
Jorge Martin Espinosa
67e262fdc8
Add banner for optional migration to simplified sliding sync (#3429)
* Add banner for optional migration to native sliding sync

- Add `MatrixClient.isNativeSlidingSyncSupported()` and `MatrixClient.isUsingNativeSlidingSync` to check whether the home server supports native sliding sync and we're already using it.
- Add `NativeSlidingSyncMigrationBanner` composable to the `RoomList` screen when the home server supports native sliding sync but the current session is not using it.
- Add an extra logout successful action to the logout flow, create `EnableNativeSlidingSyncUseCase` so it can be used there.

* Update screenshots

* Make sure the sliding sync migration banner has lower priority than the encryption setup ones

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2024-09-09 18:13:19 +02:00
Benoit Marty
375ac25d8d Migrate license to AGPL - XML files. 2024-09-06 17:43:35 +02:00
Benoit Marty
f61df38e55 Migrate license to AGPL.
Run script `uv run license-editor --repository ../element-x-android`
2024-09-06 17:19:19 +02:00
Jorge Martin Espinosa
2c8b0d0b95
Make sure to save the tokens the Client might return when its session is restored (#3378)
* Use `ClientSessionDelegate` to ensure tokens are always updated.

Refreshed tokens on client restoration might not have been stored to disk if the token refresh happened before `RustMatrixClient` was built and the `ClientDelegate` was set in it.

Using `ClientSessionDelegate` should ensure the tokens refreshed callback is called at any point in time.

* Improve how assigning the Client works, fix docs

* Fix review comments
2024-09-04 10:54:31 +02:00
renovate[bot]
9fb82a1e86
Update dependency org.matrix.rustcomponents:sdk-android to v0.2.41 (#3384)
* Introduce value class UniqueId.

* Allow reactions on non-sent Event, the SDK can now handle it.

Also the SDK will manage local echo for reactions.

* Update dependency org.matrix.rustcomponents:sdk-android to v0.2.41

* Fixes after SDK upgrade:

- Use `ClientBuilderSlidingSync` to set `SlidingSyncVersionBuilder` in `RustMatrixClientFactory`.
- `Room.toggleReaction(emoji: String, eventId: EventId)` is now `Room.toggleReaction(emoji: String, uniqueId: UniqueId)`, since reactions can now be applied to local echoes too in the SDK.

* Rename exception case

* Fix wrong error case being used in test

---------

Co-authored-by: Benoit Marty <benoit@matrix.org>
Co-authored-by: Benoit Marty <benoitm@matrix.org>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2024-09-03 20:09:33 +02:00
Benoit Marty
d867a5fe6f Cleanup notification for redacted event. 2024-08-28 10:29:01 +02:00
Benoit Marty
6309137a53 Reorder imports 2024-08-21 17:27:55 +02:00