Commit Graph

5893 Commits

Author SHA1 Message Date
Benoit Marty c92bf4bc43 Sealed interface must be immutable when uses in Composable function parameters. 2026-09-15 09:11:40 +02:00
Benoit Marty 5b0d7bf5a7 Log errors and fix quality issues 2026-09-14 18:30:29 +02:00
Benoit Marty 6887092ce4 Replace String by AccountProvider to be able to get baseUrl and serverName. 2026-09-14 09:56:16 +02:00
Jorge Martin Espinosa 8cd3750cde Make global search use a Joined filter for room results (#7695)
Before this, global search returned also invites, which wasn't planned.
2026-09-11 17:36:38 +02:00
Benoit Marty 58b0f2ebc3 Merge pull request #7591 from element-hq/bma/iterateOnClientCreation
Iterate on client creation
2026-09-11 13:22:42 +02:00
Benoit Marty 1ee156f480 Remove Showkase from the project. 2026-09-09 15:56:25 +02:00
Benoit Marty 3cde1523b4 Fix quality and tests. 2026-09-08 17:47:53 +02:00
Benoit Marty a817b6f219 Rename methods and update documentation. 2026-09-08 17:06:53 +02:00
Benoit Marty 59e72fc3ee Stop deleting the session data of a logged in account on the next login
sessionPaths keeps pointing at the directories of the account which has
just been logged in, and it was never reset. Adding another account
calls setHomeserver(), whose rotateSessionPath() starts by deleting the
directories of the previous sessionPaths, so the file and cache
directories of the first account were wiped.

finalizeClientCreation() now forgets the session paths once the login
succeeded. It is done there rather than in clear() on purpose: after a
failed attempt the directories are orphaned and must still be deleted by
the rotateSessionPath() of the next attempt.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-08 16:47:58 +02:00
Benoit Marty 579ec9bd6a Close the client used to log in before creating the client of the session
Since the login flows stopped handing their client over to
RustMatrixClientFactory and let finalizeClientCreation() build a fresh
one from the SessionData, two problems appeared.

The client built by loginWithQrCode() was never owned by anyone: it is
not assigned to currentClient, so clear() had nothing to close and the
Rust Client stayed open for the whole app lifetime, holding the session
stores of the freshly logged in account. It is now tracked in
currentClient, and also disposed of when the QR login fails, which is
safe because that flow always builds its own client.

The client of the session was also built while the login client was
still open. Both use the same session paths, so their state and crypto
SQLite stores, and the search index when message search is enabled, were
opened twice at the same time with no cross process lock to protect
them. clear() now runs before the final client is created.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-08 16:47:58 +02:00
Benoit Marty 1f18a18917 Iterate on hooks implementation 2026-09-08 16:47:57 +02:00
Benoit Marty 5ce531fd44 Ensure we create a fresh Client when the sessionId is know after authentication. 2026-09-08 16:46:46 +02:00
renovate[bot] 3df1906d2a Update dependency org.matrix.rustcomponents:sdk-android to v26.09.08 (#7668)
* Update dependency org.matrix.rustcomponents:sdk-android to v26.09.08

* Fix API breaks:

- There's no `SyncServiceBuilder.withProfilesExtension()` method anymore. This is now enabled unconditionally in the SDK.
- Timeline filters no longer use the `org.matrix.rustcomponents.sdk.TimelineEventFilter` FFI wrapper, but the `uniffi.matrix_sdk_ui.TimelineEventFilter` type directly. This also changes the underlying types used for inclusion/exclusion.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2026-09-08 16:22:14 +02: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
Jorge Martin Espinosa f0a0700f5d Bump SDK bindings to v26.09.3 (#7637)
Fix API breaks:

- A new `Mentions` room list filter is available.
- `RoomListService.subscribeToRooms` is now `RoomListService.setRoomSubscriptions`.
- `enableAutomaticBackPagination` moved from `Client` to `ClientBuilder`.
2026-09-07 14:19:19 +02:00
Benoit Marty 6f3758099b Rename the Firebase consumer keep rules file
The -dontwarn is still required: firebase-messaging ships no consumer rules and
we exclude firebase-analytics from its dependencies. Only rename the file to
consumer-rules.keep and reword the comment, which embedded a local path.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-04 14:05:08 +02:00
Benoit Marty 230279566e Keep the Showkase codegen constructor in the designsystem module
The rule only kept the class, but ShowkaseBrowserActivity instantiates it with
Class.forName(...).getDeclaredConstructor().newInstance(), so R8 was free to
strip the constructor. Also drop the AGP template comments and rename the file
to .keep, for consistency with app/proguard.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-04 14:05:01 +02:00
Benoit Marty fc519c7ddf Remove obsolete Retrofit keep rules from the network module
The three rules came from a 2022 comment on Retrofit issue #3751. Retrofit
3.0.0 now ships META-INF/proguard/retrofit2.pro, which contains two of them
verbatim and covers retrofit2.Call through its conditional return-type rule.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-04 14:04:54 +02:00
Benoit Marty 55bfcac6ff Remove empty (or comment only) proguard files. 2026-09-04 11:51:59 +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
Jorge Martin Espinosa dcd0bc782f Make sure enforce_element_pro is taken into account in FOSS (#7631)
* Make sure `enforce_element_pro` is taken into account in FOSS

* Make sure we crate `RustTemporaryMatrixClient` instances with a proper `serverName` value
2026-09-03 10:05:40 +02:00
jmartinesp dfccde93c6 Sync Strings from Localazy 2026-09-02 10:07:17 +00:00
Benoit Marty 924cf2caf3 Reorder feature flags in labs: Thread, Gallery, Knock 2026-09-02 11:02:49 +02:00
Benoit Marty 7a2f3952cb Move Gallery and Knock feature flags to Labs. 2026-09-02 10:59:51 +02:00
Benoit Marty 52fcc797b7 Merge pull request #7523 from hayaksi1/fix/1874-empty-formatted-body
Fall back to the message body when the formatted body has nothing to render
2026-09-01 11:37:59 +02:00
Benoit Marty ab09500e7e Remove unused import 2026-08-31 15:06:39 +02:00
Benoit Marty 8081682f8f Remove ExternalSession, fallback login with Element Web is gone. 2026-08-31 12:07:20 +02:00
hayyaksi b85174d35e Only track read receipts on message-like events (#7361)
Ask the SDK to track receipts on message-like events only, for the live
timeline and for the focused and threaded ones, so all three agree. The
disabled case for the media and pinned-event timelines is unchanged. 

This matches the behaviour on Element X iOS.

The SDK attaches the receipt to the preceding event rather than the next
one, which is the placement its API offers.
2026-08-31 11:44:40 +02:00
Benoit Marty 8b03e4d41a Ensure that sessionVerifiedStatus is updated when the crypto is ready.
If we do not do that the FTUE state stays on WaitingForInitialState and user is stuck on a blank screen.
2026-08-31 09:14:03 +02:00
hayaksi1 b15125289b Merge branch 'develop' into fix/1874-empty-formatted-body 2026-08-30 02:04:57 +03:00
Benoit Marty 65878c6a34 Log the SDK git Sha at application startup
Also improve the rendering of the log
2026-08-28 12:18:49 +02: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
Benoit Marty d3ab1ce43c Merge pull request #7562 from hayaksi1/fix/1548-dm-preview-sender
Drop the sender's name from the room list preview of two-person rooms
2026-08-27 11:19:32 +02:00
Benoit Marty d9c39e8f98 Merge pull request #7480 from bxdxnn/fix/deleted-messages-thread
Fix removed messages hiding its thread on deletion
2026-08-27 10:04:36 +02:00
Benoit Marty 740e3b621b Merge pull request #7344 from hayaksi1/fix/6371-save-file-name-conflicts
Keep saving files to Downloads once 32 files share the same name
2026-08-27 10:01:57 +02:00
Benoit Marty dba8f1b276 Merge pull request #7577 from element-hq/feature/bma/explorePushRules
Add a "Push rules" entry in the developer options
2026-08-26 13:54:07 +02:00
Benoit Marty 0801a415b5 Add a FileViewerEntryPoint to render in-memory content as a file
Introduce io.element.android.libraries.mediaviewer.api.FileViewerEntryPoint, a
reusable screen which renders content that is not a Matrix media the same way the
media viewer renders a file, with Share and Download actions.

The caller provides a filename, a mime type and the whole content as a String.
The node writes it to a temporary file in the cache directory, then reuses
LocalMediaView (so text content goes through TextFileViewer) and LocalMediaActions
for sharing and saving on disk. The node is contributed to AppScope so that the
screen can be used from any graph, since MediaViewerNode itself is bound to
RoomScope and depends on the timeline data sources.

Also route MimeTypes.Json to TextFileView in LocalMediaView, so that a json file
is rendered as text instead of falling back to the generic file card.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-26 12:11:04 +02:00
Benoit Marty c9da3ab490 Merge pull request #7520 from element-hq/feature/bma/updateFonts
Update fonts on the headings
2026-08-26 09:51:50 +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
hayaksi1 362acd6cab Run the database migrations again when a database is upgraded
Upgrading over an older install crashed before the login screen with
`SQLiteException: no such column: SessionData.position`. The session, cache
and push databases were opened at their new schema version but their tables
were never migrated.

`SqlCipherDriverFactory` overrides `AndroidSqliteDriver.Callback.onUpgrade` so
the database key can be replaced, and never called through to the base
implementation - which is the only thing that runs `schema.migrate`. Every
SQLDelight migration in the app was skipped as a result.

The override now calls `super.onUpgrade` after the re-key, so a database that
crosses the re-key version is still re-encrypted before its tables are
migrated. It moved out of an anonymous object into a named `MigrationCallback`
so the behaviour can be tested.

Part of #7509
2026-08-25 21:41:17 +03:00
hayaksi1 65c2cd8a79 Drop the sender's name from the room list preview of two-person rooms
The room list preview prefixes the sender's name unless the room is a
direct message. A room that was created as a group and later converted to
a direct message is not marked as one by the server, so its preview kept
naming the only other person in it on every message, while iOS did not.

The prefix now depends on how many people are actually in the room rather
than on the direct message flag, which is the behaviour asked for in the
issue: no name while only two people can be talking, the name back as
soon as a third joins.

Part of #1548
2026-08-25 20:55:38 +03:00
Benoit Marty 776cfc9c80 Add new type RoomRetention 2026-08-25 15:55:51 +02:00
Benoit Marty 16bc825c17 username has been renamed to serverNameFromUserId, but it is not necessary if we call homeserverUrl, so just remove it. 2026-08-25 15:55:29 +02:00
Benoit Marty 0634cadc9c Ensure translation of "Chats" does not render in big font when displayed on 2 lines. They can add the end be displayed on one line using the small font. 2026-08-25 11:54:15 +02:00
Benoit Marty 34a086261f PushHistoryEvents -> PushHistoryEvent 2026-08-25 10:33:58 +02:00
Benoit Marty cfa63156e2 TroubleshootNotificationsEvents -> TroubleshootNotificationsEvent 2026-08-25 10:33:16 +02:00
Benoit Marty 217ccb75ed BatteryOptimizationEvents -> BatteryOptimizationEvent 2026-08-25 10:32:34 +02:00
Benoit Marty cb8c462bad FullScreenIntentPermissionsEvents -> FullScreenIntentPermissionsEvent 2026-08-25 10:31:51 +02:00
hayaksi1 6b2e83cb63 Fall back to the message body when the formatted body has nothing to render
The HTML sanitiser in toHtmlDocument() drops every tag outside its safelist,
which does not include img. A formatted body whose only content is an image —
a custom emoji, or a bot posting an image inline — therefore cleans down to an
empty document, and because that document is not null the ?: body fallbacks in
the timeline item factory, the room list preview, the notification resolver and
plainText are all dead. The message renders as an empty bubble.

Return null from toHtmlDocument() when no text survives the sanitisation, so the
existing fallbacks take the plain text body, which for these messages carries the
alt text the sender provided.
2026-08-25 11:03:42 +03:00