Commit Graph

448 Commits

Author SHA1 Message Date
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
ganfra
4734b560f7 change (media preview config) : final refactoring and tests 2025-06-30 21:31:58 +02:00
bmarty
2e8f8ec057 Sync Strings from Localazy 2025-06-30 00:33:54 +00:00
Benoit Marty
156be26354 Rename module roomlist to home 2025-06-27 15:24:50 +02:00
ganfra
7fb0b36a9e change (media preview config) : manage migration of local data 2025-06-26 21:44:03 +02:00
Benoit Marty
f001592320 Remove ExperimentalCoroutinesApi. Not necessary anymore.
tom with ExperimentalCoroutinesApi
2025-06-12 11:51:30 +02:00
ElementBot
f32495ee58 Sync Strings from Localazy (#4842)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2025-06-11 14:13:33 +02:00
ganfra
31137fd20e misc (matrix) : use innerClient.subscribeToRoomInfo sdk method (#4838) 2025-06-09 09:10:38 +02:00
Benoit Marty
03e23477b7 Fix coroutine scope (#4820)
* Inject the session scope instead of the application scope where it's possible.

* Create AppCoroutineScope annotation to let developers explicitly choose the appropriate CoroutineScope when injecting one.
2025-06-04 15:33:51 +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
Benoit Marty
0b5e816f0d Cleanup testImplementation dependencies (#4790) 2025-06-02 10:51:02 +02:00
ElementBot
498cf15d38 Sync Strings (#4775) 2025-05-30 08:47:39 +00:00
Benoit Marty
cf17d93580 Stronger lambda error (#4771)
* Make sure lambdaError() make the test fail in all circumstances.

* Fix existing errors on tests.

* Uniformize the way we are creating class under test.

* Cleanup

* Fix typo

* Fix failing test after rebase.
2025-05-27 15:32:09 +00:00
Jorge Martin Espinosa
c67089edf7 Add ActiveRoomsHolder to manage the active rooms for a session (#4758) 2025-05-26 11:03:55 +00: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
6995e62548 Merge on boarding module to login module (#4746)
* Move onboarding code to the login module.

* Remove OnBoardingEntryPoint, move the flow to LoginFlowNode

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-05-20 08:54:23 +02:00
ElementBot
90f89b9088 Sync Strings (#4739)
* Sync Strings from Localazy

* Sync strings again

---------

Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2025-05-19 08:17:02 +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