mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
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.
This commit is contained in:
committed by
Jorge Martin Espinosa
parent
d48f5bd8b9
commit
3f19100427
+18
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2026 Element Creations Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.libraries.matrix.api
|
||||
|
||||
import java.lang.AutoCloseable
|
||||
|
||||
/**
|
||||
* A Matrix client in an 'unauthenticated' state that can still be used to resolve URLs.
|
||||
*
|
||||
* Note: this client implements an [AutoCloseable] interface, so using [AutoCloseable.close] or [AutoCloseable.use] will clean up any resources associated
|
||||
* with it, such as temporary files.
|
||||
*/
|
||||
interface TemporaryMatrixClient : GetUrlResolver, AutoCloseable
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2026 Element Creations Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.libraries.matrix.api
|
||||
|
||||
/**
|
||||
* Factory to create a temporary [TemporaryMatrixClient] for a given home server URL.
|
||||
*/
|
||||
interface TemporaryMatrixClientFactory {
|
||||
suspend fun createTemporaryMatrixClient(homeServerUrl: String): Result<TemporaryMatrixClient>
|
||||
}
|
||||
Reference in New Issue
Block a user