Commit Graph

771 Commits

Author SHA1 Message Date
Benoit Marty
5577d2ca9b Store log files in subfolder based on the homeserver domain. 2025-08-07 11:31:05 +02:00
Jorge Martin Espinosa
955263bee1 Force last owner of a room to pass ownership when leaving (#5094)
* Move `ChangeRoles*` classes to their own module so they can be shared

* Hook the change roles screen to the leave room action, add confirmation dialogs

* Use enum instead of sealed interface for `ChangeRoomMemberRolesListType`

* Try to improve communications between nodes

* refactor (leave room) : makes sure to expose only necessary code from api module

* Add `:libraries:previewutils` module to share some test fixtures used for UI previews

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
Co-authored-by: ganfra <francoisg@matrix.org>
2025-08-05 17:24:14 +02:00
Jorge Martin Espinosa
a87bbdd91c Delegate call notifications to Element Call, upgrade SDK and EC embedded (#5119)
* Stop sending call notifications manually: the Element Call widget can now assume responsibility for sending them when you start a call.

* Upgrade SDK version to `v25.8.5`, fix API breaks

* Upgrade Element Call embedded to `v0.14.1`

* Fix tests and lint issues

* Add `RoomListEntriesDynamicFilterKind.NonSpace` to avoid displaying spaces in the room list

---------

Co-authored-by: Robin <robin@robin.town>
2025-08-05 15:14:51 +00:00
Jorge Martin Espinosa
8298404630 Adapt 'change roles' screens to the new creator/owner role (#5076)
* Replace `RoomMember.Role.CREATOR` with `RoomMember.Role.Owner` - Make `RoomMember.Role` a sealed interface instead

* Adapt room member role mapping to include the power level to distinguish between admins and owners

* Use new `RoomMember.Role` sealed interface through the app

* Change how `MembersByRole` groups members to add owners to the admins section

* Adapt the `ChangeRoles` screen to the new roles:
    - Owners can't modify other owner's roles.
    - They can modify the roles of any other user, without confirmation.

* Adapt 'roles and permissions' screen:
    - Owners can't demote themselves.
    - The admin count also counts owners.

* Add more tests and screenshots

* Add owners to its own section in the 'change roles' screen

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-07-29 14:07:16 +00:00
renovate[bot]
07edaa3dcb Update dependency org.matrix.rustcomponents:sdk-android to v25.7.28 (#5088)
* Update dependency org.matrix.rustcomponents:sdk-android to v25.7.28

* Adapt to SDK changes

* Remove Sonatype repos: use Maven Central instead

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2025-07-29 11:45:52 +02:00
renovate[bot]
58e1503e61 Update dependency org.matrix.rustcomponents:sdk-android to v25.7.23 (#5073)
* Update dependency org.matrix.rustcomponents:sdk-android to v25.7.23

* Adapt to SDK changes:

- Add 'creator' role, adapt existing logic to it.
- Remove `ReplyParameters`, replace with `EventId` where possible.
- Fix changes in OIDC auth methods.
- Add more join rules.

* Make sure both creators and users with power level >= 150 are displayed as 'owners' in the room member list.

* Don't close the roles and permissions screen if the user is a creator

* Use `MediaPreviewValue.DEFAULT` for `MediaPreviewConfig.DEFAULT` too

* Improve APIs around checking roles and power levels:
    - Ensure `RoomInfo.RoomPowerLevels.users` can't be directly used to check power levels since it can't check the power levels for creators.
    - Add a few helper functions to handle actions that relied on the previous `users` property, and docs to explain their usages.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2025-07-24 11:58:30 +02:00
ganfra
9c9d33a582 misc (room id) : relax room id regex pattern to match new versions 2025-07-17 19:56:34 +02:00
renovate[bot]
04a1c00b94 Update dependency org.matrix.rustcomponents:sdk-android to v25.7.7 (#4989)
Make sure we distinguish between notification events that were filtered out and those that couldn't be resolved.

---

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2025-07-07 17:56:51 +02:00
ganfra
56520c9282 misc (tracing) : add new TraceLogPack.Notification 2025-07-04 14:35:36 +02:00
ganfra
9663e4ef37 Merge branch 'develop' into feature/fga/csam_preferences_server 2025-06-30 21:42:06 +02:00
ganfra
4734b560f7 change (media preview config) : final refactoring and tests 2025-06-30 21:31:58 +02:00
ganfra
cbc10ad50e change (media preview config) : fix JoinRule.Private case 2025-06-30 21:24:01 +02:00
ganfra
682897cdb6 change (media preview config) : introduce new apis from sdk 2025-06-26 20:34:36 +02:00
renovate[bot]
a10db58872 fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v25.6.25 (#4936)
Fix broken API changes:
- `RoomInfo.isPublic` is now optional, so we need to assume its default value in some places of the app.
- `RoomInfo.userPowerLevels` is now `RoomInfo.roomPowerLevels` and also contains this info.
- `ClientBuilder` now uses a `DecryptionSettings` value.
- The call widget settings provider now internally uses a different Rust type.
- `Client.clearCache` now takes a `syncService` so it can stop it.

---

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2025-06-25 19:25:42 +00:00
Benoit Marty
432f1ce50a Move isElementCallAvailable fun to new SessionEnterpriseService, which implementations can get the current MatrixClient. 2025-06-24 11:28:25 +02:00
renovate[bot]
eb9204e31f fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v25.6.23 (#4917)
* fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v25.6.23

* Fix API break.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2025-06-24 11:23:20 +02:00
ganfra
f710b28dc5 change (accept invite) : map Unknown error to AcceptInvite.Failures.InvalidInvite 2025-06-20 16:36:01 +02:00
Benoit Marty
5ee33a8d16 Merge pull request #4889 from element-hq/feature/bma/genericNotification
Show generic notification when Event cannot be resolved
2025-06-19 08:56:37 +02:00
renovate[bot]
31bb1848e4 fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v25.6.18 (#4894)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2025-06-18 15:10:47 +00:00
Benoit Marty
5852558681 Notification: ensure that a notification is displayed when a Push cannot be resolved.
Previously the error was logged and added to push history but no notification was shown, so the user fully miss the new message.
2025-06-17 16:00:31 +02:00
ganfra
d92d1ad3c3 feature (room upgrade) : manage navigation and clean code. 2025-06-11 13:32:12 +02:00
ganfra
aff8dd8522 feature (room upgrade) : start rendering SuccessorRoom and PredecessorRoom banners in timeline 2025-06-11 10:46:39 +02:00
ganfra
2b318277c6 deps (matrix rust sdk) : bump version to 25.06.10 2025-06-10 16:01:20 +02:00
夜坂雅
91b925c3ee feat: Support matrix: links (#4839) 2025-06-09 16:40:45 +02:00
ganfra
31137fd20e misc (matrix) : use innerClient.subscribeToRoomInfo sdk method (#4838) 2025-06-09 09:10:38 +02:00
Jorge Martin Espinosa
c02c1ae1bd fix: Make Client.findDM return a Result (#4816) 2025-06-04 08:41:26 +00:00
Jorge Martin Espinosa
58a3ea8b1f Add catchingExceptions method to replace runCatching (#4797)
- Add `runCatchingExceptions` and `mapCatchingExceptions` to replace `runCatching` and `mapCatching`.
- Make `tryOrNull { ... }` catch only exceptions too.
- Apply the changes to the whole project.
- Add new Rust fakes for tests to handle the code that's now unblocked - previously it just threw an `UnsatisfiedLinkError` which we ignored.
- Add a new `detekt-rules` project with a `RunCatchingRule` to prevent `runCatching` and `mapCatching` usages.
2025-06-04 09:02:26 +02:00
ganfra
cfbbccb09d Merge branch 'develop' into feature/fga/user_moderation_bottomsheet 2025-06-03 10:46:12 +02:00
ganfra
45369e6910 dependencies (rust sdk) : replace RoomTombstone by SuccessorRoom 2025-06-02 20:33:34 +02:00
ganfra
b25f9571f2 Merge branch 'develop' into feature/fga/fix_left_room_membership_change 2025-05-27 22:08:17 +02:00
Jorge Martin Espinosa
f8d7b4dfc9 Notification events resolving and rendering in batches (#4722)
- Use `NotiticationService.getNotifications()` function so we resolve the events in bulk.
- Added `NotifierResolverQueue` to group the notifications to resolve based on a debounce strategy.
- Batch rendering of these events as notifications.
2025-05-26 17:10:20 +02:00
ganfra
03e1926e14 Merge branch 'develop' into feature/fga/user_moderation_bottomsheet 2025-05-23 17:28:48 +02:00
ganfra
198bff9915 fix (left room membership) : use correct membership change and add test 2025-05-22 21:41:44 +02:00
Benoit Marty
f20caebdcb Add support for login link (#4752)
* Add support for login link

https://mobile.element.io/element?account_provider=example.org&login_hint=mxid:@alice:example.org

* Update screenshots

* Reduce code duplication

* Add test on OnBoardingPresenter

* Fix tool

* Ignore login parameter if user is not allowed to connect to the provided server.

* Improve tests.

* Cleanup

* Revert change on Project.xml.

* Add documentation

* Improve LoginHelper

* Rename LoginFlow to LoginMode

Move LoginFlow to package io.element.android.features.login.impl.login
Rename some implementation of LoginMode
Rename LoginFlowView to LoginModeView

* Change launchMode of MainActivity from `singleTop` to `singleTask`

Using launchMode singleTask to avoid multiple instances of the Activity when the app is already open. This is important for incoming share and for opening the application from a mobile.element.io link.

Closes #4074

---------

Co-authored-by: ElementBot <android@element.io>
2025-05-21 18:19:42 +02:00
Benoit Marty
caf25894d6 Reduce API of JoinedRoom, caller must use the Timeline API from liveTimeline instead. (#4731)
This removes lots of boilerplate code.
2025-05-20 09:07:43 +02:00
Benoit Marty
3b5d365834 Fix issues on JoinedRoom / BaseRoom (#4724)
* Import type

* Add test to cover an existing issue. roomCoroutineScope is not cancelled when the class is destroyed

* Cancel roomCoroutineScope when the class is destroyed

* Move `isOneToOne` to BaseRoom, we do not need a JoinedRoom for it.

* Let `roomInfoFlow` be implemented by RustBaseRoom.

It should fix a few issues where we rely on the room info to be live, and it was not the case on RustBaseRoom.

* Add more assertions.
The test would fail anyway if roomCoroutineScope was still active, but it's more explicit with these assertions.
2025-05-15 16:08:58 +00:00
Benoit Marty
98cfddce3f Check homeserver when login using qr code (#4708)
* Login with Qr code: check homeserver validity

* QrCode login, unauthorized homeserver: update copy.

* Update screenshots

* Add unit test on SdkQrCodeLoginData

* Remove default param value.

* Remember imageAnalysis

---------

Co-authored-by: ElementBot <android@element.io>
2025-05-15 14:08:05 +02:00
ganfra
1599e038d4 Merge pull request #4718 from element-hq/feature/fga/report_room_enabled_flow
Change (report room) : check if server supports the report room api
2025-05-14 17:25:17 +02:00
ganfra
f22b921768 change (member moderation) : branch moderation on timeline 2025-05-14 11:19:07 +02:00
ganfra
405cd8e82d change (report room) : use client.isReportRoomApiSupported instead of hardcoded value 2025-05-14 11:07:17 +02:00
renovate[bot]
7ba0d75b5c fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v25.5.13 (#4716)
Adapt to SDK changes:
- Replace `RoomInfo.isTombstoned: Boolean` with `RoomInfo.tombstone: RoomTombstone?`.
- Add `loginHint` parameter to `Client.urlForOidc`.
- Remove `ClientBuilder.useEventCachePersistentStorage`, as it's not longer optional.
2025-05-13 16:29:34 +00:00
Benoit Marty
9ea4853e88 Improve the callback uri format and customization. (#4664)
* Remove unused SUPPORT_EMAIL_ADDRESS

* Improve the callback uri format and customization.

Use io.element.android for the scheme of Oidc redirection for Element X.
For nightly the scheme will be io.element.android.nightly
For debug the scheme will be  io.element.android.debug

Element Pro is using `io.element`
2025-05-05 17:46:17 +02:00
ganfra
c2568f84d2 Feature : Report room (#4654)
* feature (report room) : introduce all presentation classes.

* feature (report room) : branch entry point in the room list

* refactor (matrix ui) : move some code from appnav to matrix ui

* feature (report room) : add api on room

* feature (report room) : adjust ui

* feature (report room) : branch api

* feature (decline invite and block) : move things around and introduce presentation classes

* feature (decline invite and block) : continue to move things

* feature (report room) : remove reference to "conversation" for now

* feature (report room) : add report room action to room detail screen

* feature (report room) : enabled button state

* feature (report room) : improve code and reuse

* feature (report room) : add feature flag

* feature (report room) : change feature flag to static bool

* feature (report room) : add tests

* feature (report room) : fix ui with new api on ListItem

* feature (report room) : clean up and add more tests.

* Update screenshots

* feature (report room) : more test and fix issue

* feature (report room) : update strings

* feature (report room) : fix konsist preview

* feature (report room) : disable feature

* Update screenshots

* var -> val

* Improve preview of AcceptDeclineInviteView

* Improve preview consistency

* Add missing test on DismissErrorAndHideContent

* Update screenshots

* Add missing tests

---------

Co-authored-by: ElementBot <android@element.io>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2025-05-02 12:25:19 +02:00
Benoit Marty
db6bc7c04f Render kick and ban reason in the timeline when available (#4642)
* Map the reason to RoomMembershipContent

* Create function to create RoomMembershipContent.

* Render reason for kick and ban state event.
2025-04-30 18:13:53 +02:00
Jorge Martin Espinosa
c537e94146 Split MatrixRoom into BaseRoom and JoinedRoom (#4561)
`JoinedRoom` will now contain both a mandatory live timeline reference and all the functionality associated to it.

`BaseRoom` on the other hand will contain only functionality that's shared for both joined and not joined rooms.

`NotJoinedRoom` is a wrapper around `RoomPreviewInfo` data and a possible local `BaseRoom`, if it exists.

The `RustRoomFactory` cache is now gone since the persistent event cache should have the same effect.
2025-04-23 15:53:40 +02:00
Benoit Marty
4486d5205c OIDC configuration (#4623)
* Login: more logs.

* Login: map Oidc error to provide more information in the error dialog.

* Oidc: use the application name.

* Oidc: move configuration from OidcConfigurationProvider to OidcConfig and add some comments.

* Oidc: limit to only 1 contact in the configuration.

* Oidc: Move configuration to BuildConfig file.

* Remove unused const.

* Add missing test on Exception mapping

* Remove contacts from OidcConfiguration.

https://github.com/matrix-org/matrix-rust-sdk/pull/4958
2025-04-23 11:58:38 +02:00
ganfra
f5c3c91299 change (sdk) : add topic string to NotificationContent.StateEvent.RoomTopic 2025-04-22 14:53:37 +02:00
Jorge Martin Espinosa
73b4ac8c12 Upgrade Rust bindings to v25.04.11 (#4580)
* Upgrade Rust bindings to `v25.04.11`

* Rename `mapMessageKind` back to `mapMessageType`

* Fix tests and fixtures
2025-04-11 18:22:16 +02:00
ganfra
497022291b Merge branch 'develop' into feature/fga/advanced_settings_moderation_and_safety 2025-04-10 18:32:04 +02:00
ganfra
64f139750c change (preferences) : bind timeline media preview with join rule 2025-04-10 18:10:37 +02:00