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>
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.
* 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>
* Hide message notification content by default when the app is locked
* Make this the default without an option
* Fix test
* Update DefaultNotificationDrawerManager.kt
* Fix
* 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>
* 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.
This happens when building a `ShortcutInfoCompat` in `DefaultNotificationConversationService.onSendMessage` when the provided room name is not null but it's empty.
`AnalyticsLongRunningTransaction.PushToWorkManager` was incorrectly used instead of `AnalyticsLongRunningTransaction.PushToNotification`, resulting in wrongly formatter analytic traces
* 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>
* 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`)
* First live location sharing sending implementation
* Simplify logic around canStop sharing
* Add some debug logs around LiveLocationSharingService
* Add LiveLocationException
* Expose beaconId to identify the current share
* Throttle live location instead of debouncing
* Keep sync alive when sharing live location
* Improve LiveLocation sharing
* Show LiveLocationDisclaimer
* Read minDistanceUpdate in LiveLocationSharingService
* Set minDistanceUpdate in AdvancedSettings
* Display banner in room when sharing live location
* Fix tests around LiveLocationSharing
* Ensure shares are properly restarted/stopped when app is re-launched
* Ensure LLS data is cleared when session is removed
* Update and fix LLS tests
* Handle Start LLS in ui
* Add check LLS permissions
* Remove hardcoded strings
* Fix quality and format
* Create DeviceLocationProvider so we can share location data between sources (presenter/live location service)
* Update screenshots
* Fix warning
* Do not try to stop if it was not sharing
* Revert "Create DeviceLocationProvider so we can share location data between sources (presenter/live location service)"
This reverts commit ba12bd968e82941cc231bdbb449310b24c97c5b8.
* Tweak location provider config values
* Address PR review remarks
* Fix ktlint
* Update screenshots
* Fix some tests after merging develop
* Adjust TimelineItemLocationView ui to match figma
* Update screenshots
* Documentation and cleanup
* Remove temporary resource
---------
Co-authored-by: ElementBot <android@element.io>
Co-authored-by: Benoit Marty <benoit@matrix.org>
Co-authored-by: Benoit Marty <benoitm@matrix.org>
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.
* 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>
* 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>
* 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
* 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>
* 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.
* 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.
* 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.
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.
* 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
* 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.