1
0
mirror of https://github.com/element-hq/element-x-android.git synced 2026-10-23 18:49:00 +03:00

762 Commits

Author SHA1 Message Date
Jorge Martin Espinosa
2a8ce3eff2 Allow getting notifications from other sessions in the same device (#7977)
This adds a feature flag, disabled by default, which disables the 'don't receive push notifications from other accounts used in this device' rule, which is useful in general, but problematic for testing.
2026-10-21 17:12:47 +02:00
Benoit Marty
9ac71fd35d Fix room id parsing from notification tags
Thread notification tags have the form "roomId|threadId". clearReadRoomsNotifications
was building a RoomId from the whole tag, which is only validated in debug builds, so
in release an invalid room id reached RoomListService.room(). Add
NotificationCreator.getMessageNotificationRoomId(), the inverse of messageTag(), which
only keeps the part before '|' and checks it is a valid room id.

Also make RoomListServiceInterface.roomOrNull take a RoomId instead of a String.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-15 12:56:46 +02:00
Benoit Marty
6efb10df11 Write the push history off the main thread
The push history was written to the database synchronously, from the app coroutine scope which runs on the main thread, for every received push. Make PushHistoryService.onPushResult suspend and run all the database queries on the IO dispatcher.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 14:33:17 +02:00
bmarty
8100fa6555 Sync Strings from Localazy 2026-10-12 00:37:35 +00:00
ganfra
2cda8a0315 Merge pull request #7851 from element-hq/sync-localazy
Sync Strings
2026-10-06 13:30:00 +02:00
Benoit Marty
ac2b76de61 Merge pull request #7859 from element-hq/feature/bma/fixPackageNames2
Fix remaining package names and namespaces not matching their module
2026-10-06 13:13:39 +02:00
Benoit Marty
08a0885cfc Merge pull request #7821 from element-hq/bma/removeUnusedDependencies
Remove unused Gradle dependencies
2026-10-06 12:23:32 +02:00
Benoit Marty
fe8b3764e5 Move matrixmedia sources to the libraries.matrixmedia.* packages
The matrixmedia modules were using the `libraries.matrix.ui.media` package
(shared with the matrixui module) and `libraries.matrix.ui.media.*`
namespaces. Use `libraries.matrixmedia.api`, `libraries.matrixmedia.impl`
and `libraries.matrixmedia.test` instead, matching the module paths.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-06 12:10:14 +02:00
Jorge Martin Espinosa
b76548f9a2 Dismiss notifications for rooms fully read in other devices (#7846)
* Dismiss notifications for rooms fully read in other devices
2026-10-05 17:56:16 +02:00
bmarty
50460ad031 Sync Strings from Localazy 2026-10-05 00:40:51 +00:00
Benoit Marty
954eb731e7 Remove unused Gradle dependencies
Remove dependencies flagged as unused by the Dependency Analysis Gradle Plugin
(`./gradlew buildHealth`) and explicitly declared in module build files.

Removals were skipped when the dependency provides transitively something the
module (or a consumer of an `api` dependency) uses directly, as well as for
runtime-only dependencies (element-call-embedded, sentry-android,
rustls-platform-verifier). Dependencies added by the convention plugin helpers
(composeDependencies, testCommonDependencies) are left untouched.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 15:47:48 +02:00
ElementBot
c8c242476b Sync Strings (#7787)
* Sync Strings from Localazy

* Update screenshots

---------

Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2026-09-28 11:32:40 +02:00
bmarty
d1e0544102 Sync Strings from Localazy 2026-09-21 00:54:07 +00:00
ganfra
b54937793f Merge branch 'develop' into sync-localazy 2026-09-18 10:39:43 +02:00
Johannes Marbach
97d9707d6a Make NotificationResultProcessor.emit wait until the batch is processed (#7640)
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-09-17 16:13:06 +02:00
Benoit Marty
3e861cc646 Do not report detekt LargeClass issues on test classes (#7713)
detekt's default configuration excludes test source sets from
`TooManyFunctions` and `StringLiteralDuplication`, but not from
`LargeClass`, so large test classes were reported and had to carry a
`@Suppress("LargeClass")` annotation.

Add the same kind of exclusion to the `LargeClass` rule in
`tools/detekt/detekt.yml` and remove the 24 now-redundant suppressions
from test files. The two remaining suppressions are in production code,
where the rule still applies.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 13:56:33 +02:00
bmarty
5102f6b0fa Sync Strings from Localazy 2026-09-14 00:54:38 +00:00
ElementBot
aced1ea64d Sync Strings (#7657)
* Sync Strings from Localazy

* Update screenshots

---------

Co-authored-by: jmartinesp <480955+jmartinesp@users.noreply.github.com>
2026-09-07 14:19:38 +02:00
Johannes Marbach
8a32f5a001 Keep the push foreground service alive while notifications are fetched (#7639)
* Keep the push foreground service alive while notifications are fetched

* Release the push foreground service as soon as results are handed over

---------

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-09-04 10:56:41 +02:00
jmartinesp
dfccde93c6 Sync Strings from Localazy 2026-09-02 10:07:17 +00:00
Benoit Marty
3488757e2a Merge pull request #7574 from hayaksi1/fix/3835-direct-share-targets
Offer conversations in the system share sheet
2026-08-28 10:38:23 +02:00
Benoit Marty
586ae00cda Ensure that noisy notifications are still noisy when content is hidden when a PIN code is protecting the application.
Closes #7575
2026-08-27 16:22:28 +02:00
hayaksi1
6d28d91541 Offer conversations in the system share sheet
Sharing from another app listed Element X once, with no way to pick a
conversation: the Direct Share row never showed any.

The app already publishes a long-lived, conversation-categorised shortcut per
room, which is most of what the sharing shortcuts API needs. The part that was
missing is the declaration that ties those shortcuts to the share intent: the
launcher activity had no `android.app.shortcuts` meta-data, so there was no
`<share-target>` for the system to match them against.

It now ships one, matching the activity that already receives ACTION_SEND, and
the shortcuts carry the category it names.

The system offers these from Android 10 onwards, where sharing shortcuts are
handled natively. Reaching further back would additionally need the
androidx.sharetarget library, which is not added here.

Part of #3835
2026-08-26 03:18:28 +03:00
Benoit Marty
217ccb75ed BatteryOptimizationEvents -> BatteryOptimizationEvent 2026-08-25 10:32:34 +02:00
Benoit Marty
e6116d5840 Move all binding containers to a di package and normalize their method names
Every @BindingContainer now lives in a di subpackage, in a file named after
it. Containers that were declared inside a shared file (SimplePlayer.kt,
LockScreenConfig.kt, VoiceMessagePresenter.kt, TimelineItemPresenterFactories.kt,
MediaItemPresenterFactories.kt) are extracted into their own file.

Method names are made consistent too:
- @Binds functions are named bind<ConcreteParameterType>, fixing three that
  named something else (notably RoomAliasResolverBindingContainer, whose
  provider was still called providesJoinRoomPresenterFactory).
- @Provides functions are named after what they provide, and all use the
  provides prefix rather than a mix of provide and provides.

ANDROID_KEYSTORE moves back to the cryptography impl package, next to
KeyStoreSecretKeyRepository which uses it; it is not DI specific and would
otherwise be unreachable from there.

No behaviour change: Metro discovers containers via @ContributesTo and does
not care about method names, so the only call site to follow was in
DefaultVoiceRecorderTest.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 11:38:11 +02:00
Benoit Marty
1018d26211 Rename all @BindingContainer types with a BindingContainer suffix
Metro's @BindingContainer replaced Dagger's @Module, but the declarations
kept the old Module suffix. Rename them (and their dedicated files) so the
type name matches the annotation, matching UserStatusBindingContainer which
already followed this convention.

No behaviour change: Metro discovers containers via @ContributesTo, so there
were only two call sites to update, both in tests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 10:08:54 +02:00
Benoit Marty
7adbd3941a Make the PUSHER_APP_ID configurable at build time. 2026-08-19 14:20:31 +02:00
hayyaksi
12791406ca Explain a rate limiting push gateway in the notification troubleshooter (#7448)
* Explain a rate limiting push gateway in the notification troubleshooter

The push loop back test printed whatever HTTP status the gateway
answered, so a user throttled by the public ntfy.sh gateway was told
"Error: HTTP 507", which reads as a server fault rather than as a quota
they can wait out or move away from.

Map the two statuses that mean the notification was throttled onto a
typed failure and give the troubleshooter a message that says what to do.

* Import strings from localazy, remove `temporary.xml` in `:libraries:push:impl`

---------

Co-authored-by: Jorge Martín <jorgem@element.io>
2026-08-17 15:14:15 +02:00
Benoit Marty
054d592391 Sync again 2026-08-17 12:10:39 +02:00
Benoit Marty
5ac1fe2409 Remove temporary string. 2026-08-17 12:10:18 +02:00
Benoit Marty
a740423343 Sync strings. 2026-08-17 11:34:52 +02:00
Benoit Marty
f01abdc00d Add KDoc to the libraries/push API interfaces
Document PushService, GetCurrentPushProvider, NotificationCleaner and
NotificationBitmapLoader along with their members, and add the missing @param
entries across the notification interfaces.

The NotificationCleaner docs record the behaviour shared by all its methods,
which is not visible in the signatures: each one also removes the grouping
summary notification once it has no children left.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 09:33:16 +02:00
Benoit Marty
2aea4782e3 Merge pull request #7370 from hayaksi1/fix/6253-duplicate-notification-messages
Stop repeating messages that are already shown in a room notification
2026-08-13 09:13:15 +02:00
Benoit Marty
7d99bf0d52 Merge branch 'develop' into matthew/knock-push-notifications-pr 2026-08-11 17:21:34 +02:00
Benoit Marty
433f5d1d04 Merge pull request #7350 from hayaksi1/fix/5766-redaction-unknown-target
Do not notify about a redaction whose target event is unknown
2026-08-11 16:21:28 +02:00
Benoit Marty
e2a1342efa Merge pull request #7360 from hayaksi1/fix/7253-skip-other-account-notifications
Do not notify about an event sent by another account on the same device
2026-08-11 14:14:36 +02:00
bmarty
17c5d7db59 Sync Strings from Localazy 2026-08-11 09:27:29 +02:00
hayaksi1
fec71aaf4d Drop the comments from the redaction resolution
Review feedback: the filtered-out result and the test name already state
why an unmappable redaction must not notify.
2026-08-09 15:31:19 +03:00
hayaksi1
cbe555009b Stop repeating messages that are already shown in a room notification
A room notification is rebuilt from the one currently on screen: its messaging
style is extracted and the incoming events are appended. Every event was
appended unconditionally, so an event re-delivered while its notification was
still showing was added again, and the notification re-alerted each time.

Skip events whose id is already present in the existing messaging style, and
set onlyAlertOnce when the batch adds nothing new. Smart reply failures are
exempt, because that path deliberately reuses the same synthesised event id to
append the "message not sent" line. Filtering is per event rather than per
message so an image and its caption stay a unit.

This fixes the visible duplication, not the re-delivery that triggers it, and
does not help once the notification has been dismissed.
2026-08-09 15:09:59 +03:00
hayaksi1
32f7a9c836 Do not notify about an event sent by another account on the same device
With several accounts logged in, sending a message from one of them raises
a notification on every other account that shares the room. The device
notifies its owner about something the owner has just done, and the more
accounts share a room the more copies arrive.

Resolve the set of logged-in user ids once per push batch and drop an event
whose sender is one of the other accounts, using the filtered-out result
the notification pipeline already understands, so it is recorded in push
history rather than turned into a fallback notification.

The receiving session is removed from that set, which keeps the change a
strict no-op for a single account and protects the local echo that the
reply action pushes back through the same path. Filtering happens at the
one point that sees every kind of push, so messages, polls, call invites,
ringing calls and room invites are all covered.

Filtering is unconditional and has no setting; multiple accounts sit
behind an experimental flag that is off by default, so nothing changes for
a stock build.
2026-08-09 13:38:28 +03:00
hayaksi1
bc20e64c61 Do not notify about a redaction whose target event is unknown
A redaction push whose redacts field the SDK could not map was reported as
an unknown error. The result processor only suppresses filtered-out and
redacted events; every other exception becomes a visible "you have N
notifications" fallback and also raises the battery optimisation banner.

So a deleted message could produce a notification about itself, which is
the opposite of what a redaction means, plus an unrelated banner.

The branch now throws EventFilteredOut, which the processor already drops
silently, and logs at warning level so the SDK gap still shows up in push
history.

Relates to https://github.com/element-hq/element-x-android/issues/5766
2026-08-09 04:09:35 +03:00
Matthew Hodgson
0a577ffbb8 Render push notifications for live location share starts 2026-08-03 21:01:56 +02:00
ganfra
ea3788abd1 Sync Strings from Localazy 2026-07-28 14:51:37 +02: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
Matthew Hodgson
34293eb824 Refer to the knock push rule by its published MSC number (MSC4506)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uk8aPxHn3BHCe52L226jdG
2026-07-14 17:51:08 +01:00
Matthew Hodgson
c86307dead Render push notifications for knocks
The homeserver's new MSCxxxx knock push rule notifies members who can
act on a knock; the push resolver previously filtered every
m.room.member state event out, so the push produced no notification.
Split RoomMemberContent out of the filtered-out catch-all and render
membership=knock as "Requested to join" from the knocking user
(other membership changes stay filtered out).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 17:50:30 +01: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