Commit Graph

748 Commits

Author SHA1 Message Date
Jorge Martin Espinosa 8b1b5560d9 Add recent search results to global search (#7742)
* Add global search results history: keep the latest 25 items used in the global search, save them to an encrypted file store.

* Integrate the search history in the global search feature

* Add `MatrixClient.getRoomInfo` and use it in `GlobalSearchPresenter`

---------

Co-authored-by: ElementBot <android@element.io>
2026-09-22 15:17:57 +00:00
Benoit Marty 6887092ce4 Replace String by AccountProvider to be able to get baseUrl and serverName. 2026-09-14 09:56:16 +02:00
Benoit Marty 8081682f8f Remove ExternalSession, fallback login with Element Web is gone. 2026-08-31 12:07:20 +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
bxdxnn 65a827559b Merge 2026-08-24 10:30:25 +00:00
Jenna Vassar 2182840a71 Let users enter their full Matrix user ID on the account provider screen 2026-08-21 08:53:23 -07:00
hayyaksi 918015b8bb Stop waiting for a room alias that the remote server never resolves (#7446)
Tapping a room alias whose server is down left the resolver screen on a
spinner for as long as the screen stayed open, with no way forward other
than going back.

Bound the resolution with the ten second timeout already used when
joining a room by address, so the retry dialog is shown instead. The fake
client's resolve lambda becomes suspending so a server that never answers
can be simulated.
2026-08-20 09:34:15 +02:00
bxdxnn 2ff6a56e7d Use the new SDK thread info for redacted messages 2026-08-19 16:12:15 +00:00
ganfra cf2ce2bd65 Use Profiles sliding sync extension check for own profile subscription (#7403)
* Use Profiles sliding sync extension check for own profile subscription

---------

Co-authored-by: Jorge Martin Espinosa <jorgem@element.io>
2026-08-19 13:00:27 +02:00
Jorge Martin Espinosa a1e86ad499 Use the right base URL for the ESS config/well known endpoints (#7469)
* Rename `UrlContentFetcher` to `ClientUrlContentFetcher` and add missing base URL data (server name, homeserver URL)

* Avoid passing the `homeserverUrl/serverName` around.

Calculate the URL in `DefaultRemoteEnterpriseConfigRetriever` using the newly added `homserver` and `server` values as the possible base URLs, depending on the remote config source

* Make sure we don't perform blocking requests to fetch the remote config when restoring a session

Add a `needsRefresh` parameter to `RemoteEnterpriseConfigResult.NotFound` to handle this, and store a `no-config` value in the store to indicate an endpoint has been checked and no config was found

* Bump enterprise module
2026-08-19 09:24:22 +02:00
Jorge Martin Espinosa c31d7e6cce Don't restart the sync service if the client is shutting down (#7472)
* Don't restart the sync service if the client is shutting down

This was causing issues when clearing the cache:

1. The client would ask the SDK to clear the caches.
2. The SDK would stop the sync service, clear the caches and set the `pos` value of sliding sync to 0 so the HS returns all the required state the next time the client is used.
3. However, between the sync service being stopped with the `pos=0` change and the client being destroyed, there was enough time for the `SyncOrchestrator` to decide the sync service was stopped for no good reason since there is network connectivity and the app is on foreground, so it restarted the sync, with `pos=0`.
4. This value was persisted, and the next time the new client did an 'initial sync' it had a `pos != 0`, which the HS uses to avoid returning some required state it already fetched.
5. The room list now lacks state events for lots of rooms and room names, avatars, members, etc. are now missing.

---------

Co-authored-by: Benoit Marty <benoitm@element.io>
2026-08-18 16:50:57 +00:00
Jorge Martin Espinosa 22195a47f2 Move the custom tile server URL config to the Element wellknown content (#7416)
* Move the custom tile server URL config to the Element wellknown content

* Iteration: use whole `MapTilerConfig` in the remote config
2026-08-14 08:20:37 +02:00
Benoit Marty 90a2a258d1 Merge branch 'develop' into fix/5794-account-data-api 2026-08-11 14:03:39 +02:00
Jorge Martín e371b46c68 Rename GetUrlResolver to UrlContentFetcher and TemporaryMatrixClientFactory.createTemporaryMatrixClient to just create 2026-08-11 13:18:49 +02:00
Jorge Martín e24468c74f Fix and add tests 2026-08-11 13:18:49 +02:00
hayaksi1 33bdf968c5 Expose global account data get and set on MatrixClient
MatrixClient had no way to read or write global account data although the
underlying client supports it.

Add getAccountData and setAccountData to the interface and implement them in
RustMatrixClient using the same withContext/runCatchingExceptions idiom as the
neighbouring methods. The content is the raw JSON string the SDK returns and
accepts: event types are open ended, so a typed wrapper belongs to whichever
caller needs one. Scope is limited to global account data; the room level
variant and the change notification APIs can follow when a feature needs them.
2026-08-09 15:10:00 +03:00
ganfra c35a0a3864 Sync automatic call status with user status flag and server support 2026-08-06 11:09:49 +02:00
ganfra ac6cacb415 Add MatrixClient.isUserStatusSupported 2026-08-05 16:14:59 +02:00
hayyaksi e6d4472c0c Index messages locally in an encrypted on-device store so encrypted rooms can be searched at all (#7249)
* Add a message search abstraction over the Rust SDK's local index

Wraps the SDK's search service so the rest of the app never sees MatrixRustSDK
types, following the existing convention in libraries/matrix.

- MessageSearch, MessageSearchService, MessageSearchResult and
  MessageSearchPaginationState describe the surface in the api module.
- RustMessageSearch and RustMessageSearchService implement it, with
  MessageSearchResultMapper and MessageSearchResultsProcessor turning SDK results
  into Kotlin data classes.
- TantivyQueryEscaper escapes the query so a user typing ":)" or "AND" searches
  for that literal text rather than tripping the tantivy parser, and joins every
  word as a Must clause.
- Fakes and unit tests cover the mapping, the processor and the escaper, the last
  checked against a real tantivy 0.26.1 parser.

* Attach the encrypted search index behind a disabled feature flag

Gives the client an on-device tantivy index encrypted with the session's client
secret, so encrypted rooms can be searched at all.

- The index store is attached at ClientBuilder time via withSearchIndexStore, in
  a search-index directory alongside the session, keyed on the client secret. A
  session without one gets no index.
- MatrixClient exposes isMessageSearchAvailable so callers gate on the real
  indexing capability rather than on the raw flag, and getCacheSize() counts the
  index directory so it stays visible in the settings figures.
- FeatureFlags.MessageSearch (feature.message_search) is off by default and
  isFinished = false. It is read once at ClientBuilder time, so develop stays
  releasable and nothing reaches a user.

* Simplify search index wiring following review

Tie search availability to the MessageSearch feature flag alone and let
the index be created without a client secret, encrypting it only when
the session has one, matching the SDK's SQLite stores. Make
getBaseClientBuilder take the flag as a required parameter and return
ClientBuilder directly again, dropping the BaseClientBuilder wrapper
and the mid-restore snapshot parameter. Check the flag through
FeatureFlagService in RustMatrixAuthenticationService instead of
caching it in a field, and revert the extra matrix_sdk_search tracing
target, which belongs in the SDK's defaults.
2026-07-30 11:17:40 +02:00
Jorge Martin Espinosa 674354b1a6 Enforce HS disabling E2EE in DM creation too (Element Pro) (#7292)
This part was missing from the implementation of this Element Pro feature, which incorrectly only applied to rooms.
2026-07-29 09:17:41 +00:00
Jenna Vassar fe24aeb2ce Add a password strength estimator wrapping the SDK zxcvbn API (#7186)
* Add a password strength estimator wrapping the SDK zxcvbn API

* Add tests for the password strength estimator SDK mapping

---------

Co-authored-by: ElementBot <android@element.io>
2026-07-28 10:30:06 +00:00
ganfra 2152552daa Add displayedStatus parameter to test fixtures for user status 2026-07-22 17:28:30 +02:00
ganfra 06a903718b Display user status next to display names across rooms and profiles 2026-07-22 17:27:21 +02:00
Jorge Martin Espinosa 62cc7e0505 Allow homeserver to disable encryption in Element Pro (#7198)
* Allow HS to disable encryption in Element Pro

Add `force_disable_e2ee` support in the Element well known retriever and cache to allow a homeserver to disable encrypted room creation and enabling encryption in an existing room in Element Pro clients

* Bump enterprise repo back to `main` branch
2026-07-15 13:29:16 +02:00
ganfra 3f7ed5d87a Merge branch 'develop' into feature/fga/local_network_permission
# Conflicts:
#	libraries/androidutils/src/main/AndroidManifest.xml
2026-07-09 17:50:24 +02:00
ganfra d25362dd36 Merge branch 'develop' into feature/fga/set_user_status 2026-07-08 17:59:30 +02:00
ganfra e9abed9178 Expose homeserverUrl on MatrixClient 2026-07-08 17:11:26 +02:00
Jorge Martin Espinosa 885e042c12 Initial content scanner integration (#7139)
* Create a `ContentScanner` component:

- Add `:features:contentscanner:api` module with the interface.
- Implement the concrete component using the Rust SDK in `:libraries:matrix:impl`.

This can be used to both set up the content scanner media fetching in the SDK Client and manually scanning media sources from the Android side

* Create `ContentScannerUrlProvider` in a new `:features:contentscaner:api` module as a noop implementation

Use it as a placeholder for the code to instantiate a `RustContentScanner` with the fetched URL and set it as part of the SDK client.

* Expose the optional `ContentScanner` in the `@SessionScope`

* Split the storage part of the Element well-known retriever so it can be reused for the non-session bound retriever.

Also add the new `content_scanner_url` field to it.

This will be used by the enterprise code to fetch the actual content scanner url.

* Bump enterprise commit to have access to the actual content scanner url provider implementation

* Fix tests and lint issues

* Use the right namespace for `:features:contentscanner:api`, also use the right namespace for `impl`

---------

Co-authored-by: Benoit Marty <benoitm@element.io>
2026-07-08 07:50:22 +00:00
Benoit Marty ac1be8c87a Merge branch 'develop' into feature/bma/scroll-to-unread-messages 2026-07-03 14:30:14 +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
Aliaksandr Daroshchanka b8752152cf Add read all messages feature (#7049)
* Add read all messages feature: read all messages using Client.markAllRoomsAsRead() method

* Move the 'mark all rooms as read' footer as part of the list item

* Replace `showMarkAllRoomsAsReadConfirmation` and its associated event with `MarkAllRoomsAsRead(val needsConfirmation: Boolean)` and a `AsyncAction.Confirming` state

---------

Co-authored-by: Jorge Martín <jorgem@element.io>
2026-06-30 11:43:27 +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
ganfra 0528b787c9 Add UserStatusPresenter with full test coverage 2026-06-25 12:32:31 +02:00
ganfra 1640adcf9d Fix thread-safety and dispatcher consistency in user status stubs 2026-06-25 12:32:31 +02:00
ganfra 742902ef02 Add setUserStatus/clearUserStatus stubs to FakeMatrixClient 2026-06-25 12:32:31 +02:00
Jorge Martín b38b5a924f Remove Room.clearEventCacheStorage since it's not supported by the SDK anymore 2026-06-24 13:29:28 +02:00
Benoit Marty 355894cc74 Merge pull request #6944 from element-hq/feature/custom-recovery-key-wellknown
Add well-known parsing and extension seam for custom recovery passphrase
2026-06-17 13:58:22 +02:00
Jorge Martin Espinosa ac93044f49 Fix ANRs when calculating DB sizes for Sentry (#7017)
* Fix ANRs when calculating DB sizes for Sentry

Instead of using the SDK's `Client.getStoreSizes()` method, manually check the sizes using the file system.

For this, the `SessionPaths` need to be synchronously accessible from a `MatrixClient`. I removed `SessionPathsProvider` too since it's not needed anymore.
2026-06-16 16:49:09 +02:00
Jenna Vassar 5a2977134b Gate out-of-window jump-to-unread on genuinely unread displayable content
The jump-to-unread FAB could surface an OutOfWindow target when the
fully-read marker event was either loaded-but-not-displayed (state/filtered
events) or when there was nothing displayable to jump to. Add two guards to
the recompute:

- Require roomInfo.numUnreadMessages > 0, so the FAB only appears when there
  is genuinely unread "interesting" content (never state/hidden events).
- Add Timeline.isEventLoaded to distinguish "in the loaded window but not
  rendered" from "genuinely outside the window", falling back to the SDK only
  after the cheap display-index check (isKnown) misses.

The RustTimeline implementation reads the replay cache first and releases the
EventTimelineItem native handle via use {} when probing the SDK. Adds presenter
tests for the loaded-but-not-displayed and no-unread-messages branches.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 18:05:22 -07:00
Benoit Marty 0bcf8e3a6b Merge pull request #6865 from bxdxnn/feat/myroomnick
Add `/myroomnick` slash command to change your display name in the current room
2026-06-05 14:24:50 +02:00
Jenna Vassar 0cb9d2911d Allow enableRecovery to derive the key from a passphrase
enableRecovery now takes an optional passphrase and returns the recovery
key as the suspend result (like resetRecoveryKey), avoiding the
flow/return-value race. For the passphrase path the SDK-derived base58
key is kept out of the session-scoped progress flow so it is never
surfaced to the user; the caller receives it as the return value and is
responsible for scrubbing it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 13:52:08 -07:00
Benoit Marty 4a90768893 Read map tiler custom style from matrix .well-known file
Closes #6844
2026-05-26 16:14:09 +02:00
bxdxnn 51aa8208e0 Add /myroomnick slash command 2026-05-26 07:36:57 +00:00
renovate[bot] 7e42dd1529 Update dependency org.matrix.rustcomponents:sdk-android to v26.05.20 (#6831)
* Update dependency org.matrix.rustcomponents:sdk-android to v26.05.20

* Fix API breaks:

- Handle new `ClientBuildException.InvalidRawKey` variant.
- `RoomInfo` now has a `fullyReadEventId` .

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2026-05-21 12:27:29 +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
ganfra e49e183178 Feature : share live location (#6741)
* 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>
2026-05-11 08:19:28 +00:00
Benoit Marty 15162e4e32 Merge pull request #6726 from element-hq/feature/bma/renameVerificationMethod
Rename verification methods
2026-05-06 17:50:11 +02:00
renovate[bot] f4cf704335 Update dependency org.matrix.rustcomponents:sdk-android to v26.05.6 (#6734)
* Update dependency org.matrix.rustcomponents:sdk-android to v26.05.6

* Fix API breaks:

- Add `RoomMember.isServiceMember`.
- Add `beacon` and `beaconInfo` power levels.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2026-05-06 15:31:52 +02:00
Benoit Marty 0a9259604b Improve FakeSessionVerificationService 2026-05-05 15:29:32 +02:00
Benoit Marty 51bcaca9db Rename methods around verification, to match SDK naming. 2026-05-05 12:17:51 +02:00