Commit Graph

1079 Commits

Author SHA1 Message Date
bxdxnn 2ff6a56e7d Use the new SDK thread info for redacted messages 2026-08-19 16:12:15 +00:00
Benoit Marty 9e32801d02 Merge pull request #7426 from element-hq/feature/bma/documentation
Add KDoc to all the interfaces of the api modules
2026-08-14 13:46:28 +02:00
Benoit Marty 1ab401482a Fix formatting issues 2026-08-14 12:20:49 +02:00
Benoit Marty 69e466a8e1 Add KDoc to the remaining matrix API interfaces
Document the permalink, widget, tracing, core, platform, server and analytics
interfaces along with their members, which completes libraries/matrix/api: all
69 in-scope interfaces and their 398 members now carry documentation.

Notable points recorded here: PermalinkParser reports an unrecognised uri as a
fallback link rather than failing, MatrixWidgetDriver.run is a no-op while it is
already running and send is silently ignored once closed, and every member of
CallAnalyticCredentialsProvider is null when the service is unconfigured or the
user has not consented to analytics.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 09:27:01 +02:00
Benoit Marty 99bbd0e29e Add KDoc to matrix API notification and pusher interfaces
Document NotificationSettingsService and PushersService along with all their
members, and complete the NotificationService documentation.

Fix the documentation of notificationSettingsChangeFlow, which described a state
flow of room notification settings when the member is a SharedFlow<Unit> that
only signals that the push rules changed. That was the sole reference to
RoomNotificationSettingsState in the file, so its now unused import is removed.

The docs also explain why so many of these methods take isEncrypted and
isOneToOne: Matrix keeps a separate default push rule per combination.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 09:16:53 +02: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 68e5ea5a74 Add KDoc to matrix API media, mxc and scanner interfaces
Add the interface level docs that MediaPreviewService, MatrixMediaLoader and
MxcTools were missing, document MediaFile.path and the nested
ContentScannerUrlProvider.Factory, and add the missing @param entries.

Most members in these packages already had accurate documentation and are left
untouched.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-13 19:30:24 +02:00
Benoit Marty 1e19f5b607 Add KDoc to matrix API room list, directory and spaces interfaces
Document RoomDirectoryService, RoomDirectoryList, SpaceService, SpaceRoomList
and LeaveSpaceHandle along with their members, add the missing DynamicRoomList
page size doc and the missing @param entries, and give MessageSearchService the
interface level doc it was lacking.

The docs make the ownership rules explicit, since they differ across these
types: a SpaceRoomList and a LeaveSpaceHandle are owned by the caller and must be
destroyed or closed, while a RoomDirectoryList and a MessageSearch are released
when the scope they were created with completes.

RoomList, RoomListService and the search interfaces were already accurate and are
left untouched.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-13 19:28:15 +02:00
Benoit Marty 0b2d6eafc3 Add KDoc to matrix API authentication and device linking interfaces
Document MatrixAuthenticationService, OAuthRedirectUrlProvider, the two QR code
login data interfaces, and the four device linking interfaces, along with their
members and parameters.

The docs record the ordering constraints a caller has to respect: setHomeserver
must precede any login attempt, the link handlers report their outcome through
their step flow rather than through a return value, and ContinuationMessageSender
expects exactly one of cancel or confirm.

The oauth package holds only a sealed interface, so it is out of scope here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-13 19:14:00 +02:00
Benoit Marty fa01166197 Add KDoc to matrix API encryption and verification interfaces
Document EncryptionService, SessionVerificationService and
SessionVerificationServiceListener along with their members, and add the missing
@param entries.

From RustEncryptionService: the backup and recovery state flows report a
waiting-for-sync value for as long as the session is not syncing, and
isLastDevice and hasDevicesToVerifyAgainst are polled rather than observed.
PasswordStrengthEstimator was already accurate and is left untouched.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-13 19:10:58 +02:00
Benoit Marty 54780f0f70 Add KDoc to matrix API timeline interfaces
Document Timeline and all of its members, TimelineProvider, and the three
lazy providers carried by EventTimelineItem.

Behaviours taken from RustTimeline: collecting membershipChangeEventReceived or
onSyncedEventReceived is what keeps the timeline subscribed to the SDK, paginate
fails with CannotPaginate when the matching status forbids it, the initial
hasMoreToLoad of each pagination status depends on the timeline mode,
timelineItems also carries virtual items such as date separators, and the media
send functions return a handler the caller must await.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-13 19:07:55 +02:00
Benoit Marty 8a88638667 Add KDoc to matrix API knock, threads and permissions interfaces
Document KnockRequest and ThreadsListService along with all their members, and
add the missing @param entries to the already documented RoomPermissions.

For ThreadsListService the docs record what the implementation does with the
subscriptions: subscribeToItemUpdates starts a shared subscription on the first
call and re-emits the whole list, subscribeToPaginationUpdates replays the
current state immediately, and destroy leaves the service unusable.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-13 19:03:48 +02:00
Benoit Marty 0bd4dc39cd Add KDoc to matrix API room interfaces
Document BaseRoom, JoinedRoom, NotJoinedRoom, RoomAliasHelper and JoinRoom,
along with their members, and add the missing @param entries.

Fix the documentation of BaseRoom.getUpdatedIsEncrypted, which described the
room directory visibility instead of the encryption state it actually returns.

Behaviours taken from the implementations: BaseRoom.predecessorRoom swallows
errors into null, updateMembers only reads the cache on its first call,
JoinedRoom.syncUpdateFlow is an opaque change counter, notification settings
start in an Unknown state until updateRoomNotificationSettings is called, and
JoinRoom maps a Forbidden answer to Failures.UnauthorizedJoin.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-13 19:02:12 +02:00
Benoit Marty 5d6384e175 Add KDoc to MatrixClient
Document the interface itself and all of its 60+ properties and functions.

Notable behaviours taken from RustMatrixClient that callers cannot guess from
the signatures: getRoom and getJoinedRoom build a new closeable instance on
every call, createRoom/joinRoom/knockRoom wait for the membership to come back
through sync and report a null RoomInfo rather than a failure when that wait
times out, getCacheSize excludes the crypto database, and clearCache destroys
the client while keeping the session.

Also fix the stale wording and the malformed KDoc block on resolveRoomAlias,
and add the missing @param entries on the functions that already had a summary.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-13 18:49:45 +02:00
Benoit Marty 42d3893755 Add KDoc to matrix API session and sync interfaces
Document MatrixClientProvider, SdkMetadata, HomeserverCapabilitiesProvider,
TemporaryMatrixClientFactory and SyncService, along with each of their members.

Behaviour described here was checked against the implementations
(MatrixSessionCache, RustSdkMetadata, RustHomeserverCapabilitiesProvider,
RustTemporaryMatrixClientFactory and RustSyncService), so the docs mention the
caching, idempotence and error-wrapping that callers cannot infer from the
signatures alone.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-13 18:34:30 +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 90d4fbe0bd Apply the GetUrlResolver pattern using unauthenticated matrix clients where possible 2026-08-11 13:18:49 +02:00
Jorge Martín 3f19100427 Add TemporaryMatrixClient interface
This is an abstraction over an actual unauthenticated `Client` from the SDK that implements `GetUrlResolver`, and is supposed to be short-lived.

With this, we can use the SDK network stack to perform arbitrary GET url operations.

The `AutoCloseable` implementation makes it easier to clean up any leftover local config after using this temporary client.
2026-08-11 13:18:49 +02:00
Jorge Martín d48f5bd8b9 Have MatrixClient implement GetUrlResolver 2026-08-11 13:18:49 +02:00
Jorge Martín c8e43bdad6 Create GetUrlResolver interface
Implementations should just perform a GET request and return the raw body as bytes
2026-08-11 13:18:49 +02:00
ganfra 0de78ed956 Merge branch 'develop' into feature/fga/user_status_last_pieces 2026-08-11 10:04:18 +02:00
Jorge Martin Espinosa cb3b9e7946 Add default OAUTH_CLIENT_URL_PATH alternative (#7385)
* Add default `OAUTH_CLIENT_URL_PATH` alternative

Previously this was `null`, but we want to use `apps/android` instead to identify Element X Android. Element Pro will use a different value, and other custom apps based on EP will use `null` or their own custom value, if they provided one

* Suppress lint check so the pro app can be built
2026-08-10 16:16:14 +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 0e563332ce Clean up formatting/detekt 2026-08-06 17:28:10 +02:00
Benoit Marty 9c66cd331f [Link new device] Handle split steps in the SDK 2026-08-06 17:22:10 +02:00
ganfra c35a0a3864 Sync automatic call status with user status flag and server support 2026-08-06 11:09:49 +02:00
ganfra 494dc026fa Create fun ProfileDetails.toMatrixUser method 2026-08-05 16:14:59 +02:00
ganfra 489ef4666a Map displayed status for room members and timeline events 2026-08-05 16:14:59 +02:00
ganfra ac6cacb415 Add MatrixClient.isUserStatusSupported 2026-08-05 16:14:59 +02:00
ganfra 38102747ad Wire user status through the Rust SDK and refresh profile after change
# Conflicts:
#	libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt
2026-08-05 16:14:59 +02:00
Matthew Hodgson 0a577ffbb8 Render push notifications for live location share starts 2026-08-03 21:01:56 +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 49692794f9 Allow adding a path suffix to the OAuth client URI (#7286)
* Allow adding a path suffix to the OAuth client URI
2026-07-29 09:29:44 +00: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
ganfra bd4d0cb02b Fix compilation for QR login continuation error variants added in SDK 26.07.28 2026-07-28 16:44:07 +02: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 29d9e7c1ba Merge branch 'develop' into feature/valere/timeline_active_call_rendering
# Conflicts:
#	tests/uitests/src/test/snapshots/images/features.messages.impl.timeline.components.customreaction_EmojiItemWithPopup_Night_0_en.png
2026-07-23 16:24:11 +02:00
ganfra 06a903718b Display user status next to display names across rooms and profiles 2026-07-22 17:27:21 +02:00
Valere 8109290650 code review 2026-07-17 15:33:28 +02:00
Valere 25c9f9706f Merge branch 'develop' into feature/valere/timeline_active_call_rendering 2026-07-16 10:51:34 +02:00
Jorge Martin Espinosa 0d03472c60 Content scanner (Element Pro): scan timeline events for unsafe content (#7159)
* Simplify how event content with captions are displayed

The caption component will now be added in `TimelineItemEventContentView` instead of separately in each `TimelineItem__View` component

* Make sure `CoilMediaFetcher` methods to fetch media throw errors

We need to catch them later to check if the content scanner marked some thumbnails or medias as invalid/unsafe in `AsyncImage` instances

* Add a `ContentScannerService` that allows us to manually scan a list of medias in an event and then update and store the results

The results take the form of `ContentValidationValue`, stored in a `ContentValidationState` instance tied to the event

* Create `EventContentValidationCache` to keep the `ContentValidationStates` for events in a room

* Expose `EventContentValidationCache` to Compose using `LocalEventContentValidationState`

Also add a couple of helper functions to avoid having to manually remember the states

* Use the new components to display invalid content in the timeline items

* Add `blurhash` to most media items so we can use it while validating the thumbnails/medias

* Fix custom layout issues with screenshot and UI tests

* Also check the validation state for replied-to events in the composer

* Fix and add tests

* Handle unrecoverable content validation errors too: display a 'not found' UI

* Improve the performance of `EqualWidthColumn` for the single item case

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2026-07-16 07:59:51 +00:00
Valere 3af396c505 Merge branch 'develop' into feature/valere/timeline_active_call_rendering 2026-07-15 14:12:54 +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
Valere e9b090a552 Merge branch 'develop' into feature/valere/timeline_active_call_rendering 2026-07-13 14:54:16 +02:00
Valere 8b78259b17 Temporary implem for sdk changes on beacon 2026-07-13 14:25:25 +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 02a40cf2d5 Merge pull request #7094 from element-hq/feature/fga/set_user_status
WIP : Set user status
2026-07-09 14:34:23 +02:00
Valere bdf4c56b96 Merge branch 'develop' into feature/valere/timeline_active_call_rendering 2026-07-08 17:59:59 +02:00
ganfra d25362dd36 Merge branch 'develop' into feature/fga/set_user_status 2026-07-08 17:59:30 +02:00