Commit Graph

466 Commits

Author SHA1 Message Date
Benoit Marty
73a6ba2849 Multi accounts - experimental first implementation (#5285)
* Multi account - Do not reset analytics store on sign out.

Else when 1 of many accounts is removed, the analytics opt in screen is displayed again.

* Multi accounts - first implementation.

* Multi accounts - Prevent user from logging twice with the same account

* Multi accounts - ignore automatic GoBack in case of error.

* Multi accounts - update first view when adding an account.

* Rename method storeData to addSession.

* Multi accounts - handle account switch when coming from a notification

* Multi accounts - handle login link when there is already an account.

* Multi accounts - handle click on push history for not current account.

* Multi accounts - improve layout and add preview.

* Add accountselect modules

* Multi accounts - incoming share with account selection

* Multi accounts - check the feature flag before allowing login using login link.

* Multi accounts - swipe on account icon

* Cleanup

* Multi accounts - fix other implementation of SessionStore

* Multi accounts - fix PreferencesRootPresenterTest

* Multi accounts - Add test on AccountSelectPresenter

* Multi accounts - Fix test on HomePresenter - WIP

* Update database to be able to sort accounts by creation date.

* Add unit test on takeCurrentUserWithNeighbors

* Fix test and improve code.

* Add exception

* Multi accounts - handle permalink

* Code quality

* Multi accounts - localization

* Fix issue after rebase on develop

* Fix issue after rebase on develop

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Update Multi accounts flag details.

* Add missing test on DatabaseSessionStore

* Add missing preview on LoginModeView

* Remove dead code.

* Add missing preview on PushHistoryView

* Document API.

* Rename API and update test.

* Remove MatrixAuthenticationService.loggedInStateFlow()

* Update screenshots

* Remove unused import

* Add exception

* Fix compilation issue after rebase on develop.

* Update screenshots

* Fix test

* Avoid calling getLatestSession() twice

* Rename `matrixUserAndNeighbors` to `currentUserAndNeighbors`

* Extract code to its own class.

* Add comment to clarify the code.

* Init current user profile with what we now have in the database.

It allows having the cached data (user display name and avatar) when starting the application when no network is available.

* Let the RustMatrixClient update the profile in the session database

* Fix test.

* When logging out from Pin code screen, logout from all the sessions.

tom

* Make PushData.clientSecret mandatory.
Also do not restore the last session as a fallback, it can lead to error in a multi account context, or even when a ghost pusher send a Push.

* Change test in RustMatrixAuthenticationServiceTest

* Do not use MatrixAuthenticationService in RootFlowNode, only use SessionStore

* Remove MatrixAuthenticationService.getLatestSessionId()

* Fix compilation issue after merging develop

* Add test on DefaultAccountSelectEntryPoint

* Fix compilation issue after merging develop

* Introduce LoggedInAccountSwitcherNode, to improve animation when switching between accounts.

* Rename Node to follow naming convention.

* Fix navigation issue after login.

* Remove unused import

* Revert "Fix navigation issue after login."

This reverts commit e409630856d7a7e741548016d7afe174ff1b40f7.

* Revert "Rename Node to follow naming convention."

This reverts commit 883b1f37c7207512d9f6605749977ad9045846a1.

* Revert "Introduce LoggedInAccountSwitcherNode, to improve animation when switching between accounts."

This reverts commit 9c698ff8152aceb5fd2b8b5ab5f609d28de64d24.

* Metro now have `@AssistedInject`.

* Update screenshots

* Introduce DelegateTransitionHandler and use it in RootFlowNode

---------

Co-authored-by: ElementBot <android@element.io>
Co-authored-by: ganfra <francoisg@element.io>
2025-09-26 15:45:06 +02:00
renovate[bot]
c1cd259ce7 Update metro to v0.6.7 (#5416)
* Update metro to v0.6.7

* Replace `@Inject` with `@AssistedInject` where needed

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2025-09-26 08:16:36 +00:00
ganfra
af5234478c feature (space) : use via parameter from space room 2025-09-24 14:11:46 +02:00
ganfra
635e1dc562 fix (room navigation) : fix navigation when leaving room/space from another device 2025-09-19 16:28:00 +02:00
Benoit Marty
04835efe96 Do not use MatrixAuthenticationService in RootFlowNode, only use SessionStore 2025-09-19 10:57:24 +02:00
Benoit Marty
d9755234dc Remove MatrixAuthenticationService.loggedInStateFlow() 2025-09-19 10:57:20 +02:00
Benoit Marty
acb5cb609b Introduce BugReportFlowNode, and remove NavTarget.ViewLogs from RootFlowNode. 2025-09-19 09:09:59 +02:00
Benoit Marty
595cec7d33 Merge branch 'develop' into feature/bma/testEntryPoint 2025-09-18 18:58:30 +02:00
Benoit Marty
6ad8be2b12 Merge pull request #5306 from element-hq/feature/bma/removeDeadCode
Remove dead code
2025-09-18 18:11:06 +02:00
Benoit Marty
a29878a170 Use SimpleFeatureEntryPoint when possible. 2025-09-16 14:38:32 +02:00
Benoit Marty
264472ba36 Avoid using AndroidJUnit4 runner to test Entrypoint implementations. 2025-09-16 14:38:32 +02:00
Benoit Marty
e36273b94c Add test on DefaultEntryPoints 2025-09-16 14:38:32 +02:00
Benoit Marty
629fc552e5 Use DependencyHandlerScope.testCommonDependencies() 2025-09-16 14:38:31 +02:00
ElementBot
3cf121345a Sync Strings from Localazy (#5349)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2025-09-15 08:39:59 +02:00
ganfra
65961ad404 feature (space) : add space cache and navigation to sub space/room 2025-09-10 14:31:44 +02:00
ganfra
6b9afd9e6f feature (space) : iterate on space list (and space screen) 2025-09-10 14:30:10 +02:00
Benoit Marty
a570b0d4ff Remove unused MatrixClient.availableSlidingSyncVersions(). 2025-09-09 15:19:19 +02:00
Benoit Marty
0c436451b9 Remove unused onLogoutForNativeSlidingSyncMigrationNeeded() method and cleanup dead code. 2025-09-09 14:46:07 +02:00
Benoit Marty
aee66d6316 Other cleanup 2025-09-05 16:54:45 +02:00
Benoit Marty
4e720cecb1 Rename anvil modules to annotations and codegen 2025-09-05 14:26:27 +02:00
bmarty
676d7f6c8f Sync Strings from Localazy 2025-09-05 07:44:19 +00:00
Jorge Martín
2907cef47e Some cleanup:
- Remove unnecessary `GlobalScope`.
- Rename `Component` to `Graph`, `DaggerComponentOwner` to `DependencyInjectionGraphOwner`.
- Rename component builders to factories, where necessary.
2025-09-04 16:49:21 +02:00
Jorge Martín
e06bacbff3 Redo DI gradle setup code 2025-09-04 16:49:20 +02:00
Jorge Martín
fc3153bd26 Fix lint issues and restore commented out code 2025-09-04 16:49:18 +02:00
Jorge Martín
92a4b8b66b Start migrating Anvil KSP to Metro 2025-09-04 16:48:34 +02:00
ElementBot
a43b907275 Sync Strings from Localazy (#5249)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2025-09-01 12:44:49 +02:00
Benoit Marty
516ba08f9c Remove LoginUserStory.
No that we do not have the WaitList screen anymore, this interface and implementation are useless.
2025-08-27 15:20:20 +02:00
Benoit Marty
2b42271615 Split module deeplink to api and impl. 2025-08-25 11:36:42 +02:00
Jorge Martin Espinosa
59a8aaebff Add shortcut suggestions for rooms, remove then when leaving (#5180)
* Report shortcut usage for outgoing messages

This patch adds support for creating and pushing dynamic
long-lived shortcuts for outgoing messages. This together
with an existing reference to the roomId used by the
shortcuts as an identifer allows conversations to be
prioritized.

See https://developer.android.com/training/sharing/direct-share-targets#report-usage-outgoing

* Simplify how to get the other user in a DM room

* Add initial avatar icons to shortcuts

* Remove room shortcuts when they're no longer joined

* Try using API 33 for the new tests. They worked locally with API 30, so it's weird the CI asks for a higher API version.

* Add observers for the pin code and session logout states. With this we can prevent new shortcuts from being created and remove existing ones when needed.

* Wrap all calls to `ShortcutManagerCompat` with `runCatchingExceptions` to avoid crashes

* Make `DefaultNotificationConversationService` a singleton.

---------

Co-authored-by: networkException <git@nwex.de>
Co-authored-by: ElementBot <android@element.io>
2025-08-19 16:02:51 +02:00
ElementBot
a4cee52815 Sync Strings from Localazy (#5178)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2025-08-18 11:09:27 +02:00
Benoit Marty
9c32dbba58 Inject a StringProvider instead of the context, and update tests.
Also remove the other StringProvider we had, it was not used anymore
2025-08-13 11:07:28 +02:00
ganfra
1170a44116 refactor (start chat) : start splitting things (create room, invite people, start chat) 2025-08-13 11:06:42 +02:00
Benoit Marty
0a4a4e20db Merge pull request #5160 from element-hq/feature/bma/cleanupFeatureFlags
Remove old feature flags
2025-08-12 18:21:44 +02:00
Jorge Martin Espinosa
12ea2064c7 Provide calculated server names when opening a room from another (#5155)
* Provide calculated server names when opening a room from another, based on the most frequently used domain names in the user ids for the users in the room.

This helps when following permalinks or navigating to the successor room of a tombstoned one. Previously, the `/summary` endpoint was failing because no server names were used in the `via` parameters.
2025-08-12 15:17:46 +00:00
Benoit Marty
4192633930 Remove FeatureFlag.IncomingShare 2025-08-12 15:52:05 +02:00
Jorge Martin Espinosa
28c09c1668 Fix leaving the room not always dismissing the room screen (#5089)
* Fix leaving the room not always dismissing the room screen

Use the existing `RoomInfo` membership check to dismiss the room instead of using `RoomMembershipObserver`.

* Restore `membershipObserver`, check Maestro still works

* Improve the logic for the local membership change check

* Remove redundant room id check
2025-08-12 10:37:31 +00:00
Benoit Marty
37b50e0139 Merge branch 'develop' into feature/bma/rageshakeConfigStep2 2025-08-11 17:35:06 +02:00
Jorge Martin Espinosa
a170d80cb3 Add media file limit size warning and media quality selection (#5131)
* Add `VideoCompressorPreset` enum

This represents the different compression presets used for processing videos before uploading them

* Add `VideoCompressorHelper` util class to calculate the scaled output size of the video given an input size and its optimal bitrate

Also add `MediaOptimizationConfig` which will be used to decide how to apply compression in `MediaPreProcessor`

* Add `RustMatrixClient.getMaxFileUploadSize()` function and `MaxUploadSizeProvider` so we can import only this functionality into other components

* Try preloading the max file upload size the first time we get network connectivity - it's a best effort

This should help ensure we'll have this value available later, even if we still need to load it asynchronously.

* Split the `compressMedia` preference into `compressImages` and `compressMediaPreset`

* Modify the media processing parts to use the new classes and utils

* Add `MediaOptimizationSelectorPresenter`, which will retrieve the compression values and the max file upload size, also estimating the compressed video file sizes if needed.

* Add a feature flag to allow selecting the media upload quality per upload

* Integrate the previous changes with the attachments preview screen

Add strings from localazy too.

* Adapt the rest of the app calls to upload media to using the media optimization configs

* Allow modifying the default compression values in advanced settings, based on the feature flag value

* Pass the `fileSize` in `MediaUploadInfo` too, to be able to check it against the `maxUploadSize`

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-08-11 17:22:46 +02:00
Benoit Marty
d7e4e00b5d Let enterprise build be able to override (or disable) the bug report URL. 2025-08-08 17:23:39 +02:00
Benoit Marty
b1a48ec863 Merge pull request #5126 from element-hq/feature/bma/redirectToElementPro
Redirect FOSS user to Element Pro according to element .well-known file
2025-08-08 09:38:59 +02:00
Benoit Marty
5c3054bee4 Rename fun. 2025-08-07 16:04:22 +02:00
Benoit Marty
5577d2ca9b Store log files in subfolder based on the homeserver domain. 2025-08-07 11:31:05 +02:00
Benoit Marty
6079e5a4d6 Avoid code duplication 2025-08-06 16:13:39 +02:00
Benoit Marty
2dec34374e Prevent users from using Element FOSS on homeservers that enforce the usage of Element Pro. 2025-08-06 10:23:16 +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
bmarty
a2c8107b44 Sync Strings from Localazy 2025-08-04 00:34:11 +00:00
ElementBot
1944004409 Sync Strings from Localazy (#4983)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2025-07-04 14:37:59 +00:00
Benoit Marty
c93cbb735b Suppress deprecation issue. 2025-07-01 15:59:11 +02:00
ganfra
9b593e4bb9 change (media preview config) : address review remarks 2025-07-01 11:22:03 +02:00
ganfra
9663e4ef37 Merge branch 'develop' into feature/fga/csam_preferences_server 2025-06-30 21:42:06 +02:00