Commit Graph

703 Commits

Author SHA1 Message Date
enki 9d14530660 Blap Android port: branding, ntfy push, spoilers, Discord-style home, EC fork
Sonar / Sonar Quality Checks (push) Has been cancelled
Code Quality Checks / Search for forbidden patterns (push) Has been cancelled
Code Quality Checks / Search for invalid screenshot files (push) Has been cancelled
Code Quality Checks / Search for invalid dependencies (push) Has been cancelled
Code Quality Checks / Konsist tests (push) Has been cancelled
Code Quality Checks / Compose tests (push) Has been cancelled
Code Quality Checks / Android lint check (push) Has been cancelled
Code Quality Checks / Detekt checks (push) Has been cancelled
Code Quality Checks / Ktlint checks (push) Has been cancelled
Code Quality Checks / Doc checks (push) Has been cancelled
Code Quality Checks / Check shell scripts (push) Has been cancelled
Code Quality Checks / Run zizmor (push) Has been cancelled
Code Quality Checks / Project Check Suite (push) Has been cancelled
Create release App Bundle and APKs / Create App Bundle (Gplay) (push) Has been cancelled
Create release App Bundle and APKs / Create App Bundle Enterprise (push) Has been cancelled
Create release App Bundle and APKs / Create APKs (FDroid) (push) Has been cancelled
Test / Runs unit tests (push) Has been cancelled
Post-release / post-release (push) Has been cancelled
Everything from port rounds 1-5 plus today's fixes, on top of upstream develop:

- Branding: Blap name/id (lol.utn.blap), purple #7c66e0 accent (both colorGreen*
  and colorAlphaGreen* Compound ramps remapped), Hanken Grotesk, squircle
  avatars, five-dot notification icon, de-branded strings across all locales
- Push: new libraries/pushproviders/ntfy module — FGS websocket to an ntfy
  server's Matrix gateway, no Google. Includes base64 payload decode, restart
  on boot/update/app-open, background-FGS-start crash guard, and a proactive
  battery-optimization banner (Doze kills the socket without the exemption)
- Spoilers (MSC2010, interops with Blap desktop 1.0.3): render + tap-to-reveal,
  Discord ||text|| send syntax, SPOILER_ filename convention for media both ways
- Home: Discord-style space rail, client-side room-list sections, DM-first sort
- Calls: embedded Element Call fork 0.20.3 assets (camera-off joins, bottom strip)
- Threads on by default; RTC ping timeline items hidden; reply-quote restyle
- URLs now point at git.utn.lol/enki/blap (was codeberg); version 26.07.2

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 12:56:15 -07:00
Jorge Martin Espinosa d0b4a21cfe Fix timelines not loading after marking a room as read from notification when app was killed (#7202)
This can only happen when the app was killed by the OS and then you received some notification.

This notification action creates a new `DefaultSessionPreferencesStore` when trying to fetch `isSendPublicReadReceiptsEnabled`, which would contain a different session coroutine scope than the one created when instantiating the navigation graph (`@SessionCoroutineScope`), resulting in flows that never emit any items and close automatically as 'completed'.

This in turn prevented the timeline items subscription in `TimelinePresenter` from progressing, since we're also checking `isRenderReadReceiptsEnabled` there, which is closed and in turn closes the timeline items flow.
2026-07-15 15:01:35 +02:00
Benoit Marty 264ec2416f Merge pull request #7194 from element-hq/renovate/org.matrix.rustcomponents-sdk-android-26.x
Update dependency org.matrix.rustcomponents:sdk-android to v26.07.13
2026-07-15 10:56:00 +02:00
Jorge Martín 09b7732c1b Fix API breaks:
- Add `Beacon` variants for `NotificationData`.
- Add `call` and `status` to `UserProfile`.
2026-07-14 15:45:26 +02:00
ElementBot 03304b3ece Sync Strings (#7192)
* Sync Strings from Localazy

* Update screenshots

---------

Co-authored-by: jmartinesp <480955+jmartinesp@users.noreply.github.com>
2026-07-13 12:21:55 +02:00
Benoit Marty 8840e2f96b Merge pull request #7112 from element-hq/feature/bma/galleryMessages
Support gallery messages
2026-07-03 14:09:20 +02:00
ElementBot 46460e1c27 Sync Strings (#7115)
* Sync Strings from Localazy

* Update screenshots

---------

Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2026-06-29 14:09:36 +02:00
bxdxnn 87aff40b26 Support gallery messages (#6519)
* Support gallery messages

* Address review

* Remove unused function

* Fix indent

* Add "Gallery" message prefix

* Support galleries for image editing

* Fix tapping on a tile opens the last item

* Fix overflow count

* Add caption editing to gallery messages

* Use the new gallery string for prefix

* Lock sending galleries behind a feature flag

* Fix detekts

* Fix

* Ensure image edition is saved when navigating

* Fix sending media broken on edited gallery.

* Fix tests

* Order imports

* Remove unused parameters.

* Fix copyright header of new files.

* Fix Konsist test

* Extract new previews to a dedicated file.

* Sync strings

* Remove unused import

* Update screenshots

* Trigger CI

* Remove parameters with default value.

* More cleanup

* Restore sendAsFile behavior.

* Improve Preview.

* Improve Preview.

* Improve Preview.

* Fix gallery sending cancel and retry issue

* Ensure any previous job is cancelled.

* Fix issue in summary message

* Gallery feature is disabled by default.

* Kotlin convention

* Remove useless parenthesis

* Update screenshots

* Fix test

* List -> ImmutableList

* Remove useless code.

* Render formatted caption for attachment list.

* Replace set of Booleans by an enum

* Remove unused model for individual caption in a gallery Event.

* Fix tests

* Fix tests

* Rework MediaViewer entry point.

And ensure that the clicked image from the gallery is displayed first.

* Ensure gallery item can be click in the pinned message list
Improve the gallery item click handling code.

* Improve code and fix separator color
Closes #7101

* React on attachment item click
Improve code

* Improve code and support 0 items in gallery.

* Fix click on attachment item not rendering anything.

---------

Co-authored-by: Benoit Marty <benoitm@element.io>
Co-authored-by: Benoit Marty <benoit@matrix.org>
Co-authored-by: ElementBot <android@element.io>
2026-06-26 16:00:56 +02:00
bxdxnn 790b9cff63 Hide message notification content when the app is locked (#6902)
* Hide message notification content by default when the app is locked

* Make this the default without an option

* Fix test

* Update DefaultNotificationDrawerManager.kt

* Fix
2026-06-19 15:34:38 +02:00
Benoit Marty c430877d87 Ensure Robolectric test are run using API 36 until the library support API 37. 2026-06-18 12:18:32 +02:00
ElementBot d39b208099 Sync Strings from Localazy (#7021)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2026-06-16 12:59:45 +02:00
Benoit Marty c88edc9621 Notification settings: pick custom sounds for messages and call ringtones (#6897)
* Notification settings: pick custom sounds for messages and call ringtones (#6702)

* Feature: add notification sound settings for messages and calls

* Add sound not available banner, accessibility checks

* Fix build and Konsist convention violations

- libraries:preferences:api now uses io.element.android-compose-library
  so NotificationSound's @Immutable annotation can resolve, matching the
  pattern in libraries:matrix:api.
- Rename SoundUnavailableBannerStateProvider to
  NotificationSoundUnavailableStateProvider so the class name contains
  the parameter type as required by KonsistClassNameTest.

* Suppress LargeClass on RoomListPresenterTest

The three new sound-unavailable tests pushed the class past Detekt's
default LargeClass threshold. Matches the suppression pattern already
used on five presenter test classes under features/messages/impl/test.

* NotificationSettingsView: guard ringtone-picker launchers in inspection mode

rememberLauncherForActivityResult requires a LocalActivityResultRegistryOwner,
which Paparazzi-driven preview snapshot tests don't provide, causing
NotificationSettingsViewPreview to throw IllegalStateException for every
preview parameter. Extract the click handlers into a helper that returns a
no-op when LocalInspectionMode.current is true; the runtime path is unchanged.

* Handle unresolved notification sounds mid session

* Quality checks, refactor mid session error ui

* Suppress detekt LargeClass on NotificationSettingsPresenterTest

* Remove notification sound resilience layer, replace with file copy

* Reselect element sound option, code cleanup

* Add element fade notification sound option

* Fix new file headers

* Revert to flowOf(Unit) for announcement service

* Add ringtone picker dialog to match message selector

* Update strings in conjunction with ios

* Update test to reflect new string

* Sync strings.

* Update screenshots

* Fix test

* Remove not properly located translations.
This will be fixed in the next String sync.

* Fix test on CI

---------

Co-authored-by: Jenna Vassar <jenna.vassar@toptal.com>
Co-authored-by: ElementBot <android@element.io>
2026-05-28 16:54:12 +02:00
Jorge Martin Espinosa 1e00353f29 Avoid SQLCipher key derivation (#6774)
* Avoid SQLCipher key derivation by manually providing the generated as a raw key: this needs a series of DB re-key operations, performed as part of a 'dummy' DB migration

* Set key generation length to 32 bytes in `RandomSecretPassphraseProvider`.

* Use `ClientSecret` for handling the keys for SQLCipher. Move `ClientSecret` to `:libraries:androidutils` so it's shared.
2026-05-27 17:25:51 +02:00
renovate[bot] 2e42e78307 Update dependency org.matrix.rustcomponents:sdk-android to v26.05.26 (#6885)
* Update dependency org.matrix.rustcomponents:sdk-android to v26.05.26

* Fix API break

* Fix test compilation

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2026-05-27 12:16:17 +02:00
ElementBot 0aaa80cbdc Sync Strings from Localazy (#6856)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2026-05-26 08:05:07 +00:00
Jorge Martin Espinosa 64d9336901 Fix 'Conversation label cannot be empty' error (#6823)
This happens when building a `ShortcutInfoCompat` in `DefaultNotificationConversationService.onSendMessage` when the provided room name is not null but it's empty.
2026-05-20 14:26:44 +02:00
bmarty dcc67f9fc6 Sync Strings from Localazy 2026-05-18 00:57:56 +00:00
Jorge Martin Espinosa 3234931d3c Use the right analytics span as a parent in checkNetworkConnection (#6751)
`AnalyticsLongRunningTransaction.PushToWorkManager` was incorrectly used instead of `AnalyticsLongRunningTransaction.PushToNotification`, resulting in wrongly formatter analytic traces
2026-05-12 15:04:13 +02:00
Jorge Martin Espinosa 77b444581d Improve FetchPushForegroundService's reliability (#6757)
* Improve `FetchPushForegroundService`'s reliability

- Don't use DI, we can just create the notification channel. This should speed up the creation of the service and reduce the number of `ForegroundServiceDidNotStartInTimeException` received. Also use `MainScope` instead of the app's coroutine scope.
- Move the wakelock releasing mechanism to `onDestroy` so it's always used. Previously, this would only happen when `stopService` was called, which would only happen when `stopSelf()` is called, but not when the OS or the service manager stops the service.

* Add fallback value for the notification channel title

* Replace the wrong string for the notification/channel title

---------

Co-authored-by: Benoit Marty <benoitm@element.io>
2026-05-12 11:40:46 +02:00
Jorge Martin Espinosa 11476c73cf Adapt to new DM definition changes in the SDK (#6748)
* Set `DmRoomDefinition.TwoPeople` in `ClientBuilder`. This applies the 'direct and with at most 2 non-service members' rule to what the SDK should consider a DM.

* Map `RoomInfo.isDm` from the SDK

* Map `NotificationData.isDm` from `NotificationInfo.roomInfo.isDm`

* Remove `RoomIsDmCheck` file as its extension functions are now redundant. Move `Room.isDm` helper function to `BaseRoom`.

* Map `isDm` in `SpaceRoom` from the SDK too

* Replace `isDirect` with `isDm` where possible

* Map `RoomMember.isServiceMember` from the SDK and use it to tell apart normal members of a room from service members (i.e. `RoomMembersState.getDirectRoomMember`)
2026-05-11 17:22:16 +02:00
ElementBot 0c657c258a Sync Strings from Localazy (#6761)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2026-05-11 09:37:59 +02:00
bmarty 0d2f71643a Sync Strings from Localazy 2026-05-04 00:54:27 +00:00
Benoit Marty f4b3ddfa0b Merge branch 'develop' into feature/bma/removeExternalCallSupport 2026-04-30 11:50:35 +02:00
Jorge Martin Espinosa 4a79b272ef Fix ANRs when receiving push notifications (#6696)
In Sentry there are some reports of methods called when notifications are fetched that end up having ANRs. This looked weird because everything is asynchronous... but it's still running with a `Main` dispatcher.

Using the `Default/computation` one instead should be the right call.
2026-04-30 10:51:29 +02:00
Benoit Marty 8860647477 Element Call: remove support for SPA call links.
Closes #6578
2026-04-27 17:01:08 +02:00
ElementBot 9a2ad3928a Merge pull request #6658 from element-hq/sync-localazy
Sync Strings
2026-04-27 09:17:54 +02:00
ElementBot e1b7171839 Sync Strings (#6626)
* Sync Strings from Localazy

* Use the previous plurals as plain strings

* Add extra case for 1 vs multiple users

* Update screenshots

---------

Co-authored-by: Jorge Martín <jorgem@element.io>
2026-04-20 17:09:10 +00:00
Jorge Martin Espinosa f80a140cf9 Cleanup FetchPushForegroundService (#6577)
* Rename `PushHandlingWakeLock` to `FetchPushForegroundServiceManager`. Move the start/stop logic from `FetchPushForegroundService.Companion` to it.

* Add more tests using Robolectric.

* Remove `FeatureFlags.SyncNotificationsWithWorkManager` and associated code: this should have been removed in one of the previous refactors, since we don't have the 2 ways to sync notifications anymore, everything uses the `WorkManager`

---------

Co-authored-by: Benoit Marty <benoit@matrix.org>
2026-04-20 16:03:12 +02:00
Jorge Martin Espinosa 7a7a5a68b9 Fix isInAirGappedEnvironment check for older APIs (#6573)
* Fix `isInAirGappedEnvironment` check for older APIs: use `networkCapabilities.hasCapability` instead of `networkCapabilities.capabilities.contains`, which only works on Android 12 and newer versions

* Check for air-gapped env in the FOSS app too: this unifies the notification behaviour on EXA and Element Pro
2026-04-14 15:52:41 +02:00
bmarty 23c1112dcf Sync Strings from Localazy 2026-04-13 00:48:40 +00:00
Benoit Marty c3a999e45a Merge pull request #6559 from element-hq/feature/bma/fixModuleDependencies
Fix module dependencies
2026-04-10 09:17:34 +02:00
Benoit Marty 6ff6a0a86b Merge pull request #6553 from element-hq/renovate/org.matrix.rustcomponents-sdk-android-26.x
Update dependency org.matrix.rustcomponents:sdk-android to v26.04.8
2026-04-09 13:17:58 +02:00
Benoit Marty 85823b3e62 Fix compilation issue: RoomAliases does not exist anymore. 2026-04-09 09:52:40 +02:00
Benoit Marty df73b44279 Depend on api not impl module. 2026-04-08 18:10:32 +02:00
Benoit Marty dae308fcf7 Fix crash, ensure that super.onTimeout(startId) is not called when the method is not available. 2026-04-08 11:15:51 +02:00
ElementBot 6ad85d4dfc Sync Strings (#6537)
* Sync Strings from Localazy

* Sync strings.

---------

Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2026-04-07 16:02:12 +02:00
Benoit Marty 4ad495d36c Add support for slash commands (under Feature Flag) (#6482)
* Add support for slash commands

* Update screenshots

* Rename module `slash` to `slashcommands`

* Rename `SlashCommand` to `SlashCommandService`

* Introduce MsgType in order to send text message with a different msgtype value.

* Format file and add parameter names, add default values and cleanup

* Add isSupported parameter to filter out unsupported yet commands.

* Slash commands: disable suggestions if the feature is disabled.

* Fix sending shrug command.

* Add missing test on SuggestionsProcessor

* Add tests on MessageComposerPresenter about slash command.

* Fix import ordering

* Add missing tests on CommandExecutor

* Add missing tests in MarkdownTextEditorStateTest

* Slash commands: Improve code when sending message with prefix.

* Slash commands: Add support for /unflip

---------

Co-authored-by: ElementBot <android@element.io>
2026-04-02 16:15:32 +02:00
Jorge Martin Espinosa 860def3965 Tentative fix for ForegroundServiceStartNotAllowedException (#6509)
* Tentative fix for `ForegroundServiceStartNotAllowedException`

When failing to start the service in foreground, don't crash. This is a helper to speed up the scheduling by keeping the CPU awake, not a critical part that should succeed

* Simplify `DefaultPushHandlingWakeLock`

It seems like restarting the service from background won't work in some cases, so don't try it.
2026-04-02 11:10:47 +02:00
Jorge Martin Espinosa ad56b01e4a Try handling ForegroundServiceStartNotAllowedException better (#6483)
* Try handling `ForegroundServiceStartNotAllowedException` better

The docs mention starting a foreground service when the app is on background is allowed when FCM receives a high priority notification, so we don't do it if the priority is not high.

Also, we handle the case where starting the foreground service fails so it doesn't crash the app.
2026-03-30 18:44:08 +02:00
Jorge Martin Espinosa bba2e6df3f Fix ForegroundServiceDidNotStartInTimeException (#6470)
* Start the `FetchPushForegroundService ` in foreground ASAP. This is a first step to mitigate `ForegroundServiceDidNotStartInTimeException` being thrown.

* Don't stop the service immediately if it's running but not in foreground. Try waiting up to 5s for it to be in foreground.
2026-03-27 06:54:27 +00:00
ganfra 9a984e1423 Merge branch 'develop' into feature/fga/live_location_sharing_setup 2026-03-24 10:17:24 +01:00
Jorge Martin Espinosa f1708f6366 Fix wakelock not stopping early when notifications are disabled (#6424)
If notifications for a device are disabled when there is no connection with the HS, the push registration will still exist, so the device can still receive push notifications.

In that cases, we were running into an issue where the wakelock for push notifications was started immediately after receiving a push but was never stopped and it ran for 3 minutes until its timeout, keeping the device awake for no reason.

This patch changes `DefaultPushHandler` so if we don't need the wakelock it returns `false` and we can stop the wakelock early.
2026-03-23 18:07:25 +01:00
Jorge Martin Espinosa 8e46e68630 Add a foreground service with a wakelock for fetching push notifications (#6321)
* Create `PushHandlingWakeLock` to start a foreground service:

When receiving a push and scheduling the notification fetching, several problems can happen:

1. Some async operation is waiting for a timeout and it takes way longer than that to finish (i.e. timeout of 10s but it took 30s to advance).
2. The same, but when starting new coroutines. I've seen the time between scheduling a coroutine and it running sometimes take up to 1 minute.
3. Notification fetching can be scheduled immediately, but it can take a while to actually run because the OS understands the app is now in Doze.

Having a wakelock that runs as soon as the push handling starts fixes these: it continues the previous wakelock held by either Firebase or the UnifiedPush distributor.

* Acquire the wakelock as soon as we received the pushes in both receivers

* Also release the wakelock ahead of time if possible
2026-03-17 14:24:26 +01:00
Benoit Marty 2141795d59 Merge pull request #6352 from element-hq/sync-localazy
Sync Strings - iterate on wording about crypto identity
2026-03-16 16:06:54 +01:00
Benoit Marty 13578aa09b Sync string again. 2026-03-16 14:54:06 +01:00
renovate[bot] a3ca0deb9d fix(deps): update activity to v1.13.0 (#6327)
* fix(deps): update activity to v1.13.0

* Remove usages of deprecated  `bundleOf`

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2026-03-16 08:50:43 +00:00
bmarty 299d5a9394 Sync Strings from Localazy 2026-03-16 00:42:32 +00:00
ganfra 5a40144a24 Fix some existing tests after changes 2026-03-13 10:18:28 +01:00
Jorge Martin Espinosa 912b9168fd Add network constraints for fetching notifications with WorkManager (#6305)
* Add `isNetworkBlocked` and `isInAirGappedEnvironment` to `NetworkMonitor`.

* Improve the DI of `SyncPendingNotificationsRequestBuilder` to simplify its usage.

* Only update `isInAirGappedEnvironment` in `DefaultNetworkManager` if the current build is an enterprise one.

* Add network constraints to `DefaultSyncPendingNotificationsRequestBuilder` based on the air-gapped status.

* Add a feature flag to disable the new check, in case it doesn't work as expected.
2026-03-10 12:44:31 +00:00
Valere Fedronic 95049849cc Merge branch 'develop' into valere/rtc/voice_call 2026-03-09 17:18:55 +01:00