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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
* 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
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.
* 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.
* 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>
* 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>