mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 09:25:49 +03:00
Merge pull request #6064 from vector-im/feature/bma/detekt_end_period
Detekt: fix end period
This commit is contained in:
commit
3674ae7e63
718 changed files with 1680 additions and 1673 deletions
|
@ -17,7 +17,7 @@
|
|||
package im.vector.lib.core.utils.epoxy.charsequence
|
||||
|
||||
/**
|
||||
* Wrapper for a CharSequence, which support mutation of the CharSequence, which can happen during rendering
|
||||
* Wrapper for a CharSequence, which support mutation of the CharSequence, which can happen during rendering.
|
||||
*/
|
||||
class EpoxyCharSequence(val charSequence: CharSequence) {
|
||||
private val hash = charSequence.toString().hashCode()
|
||||
|
|
|
@ -17,6 +17,6 @@
|
|||
package im.vector.lib.core.utils.epoxy.charsequence
|
||||
|
||||
/**
|
||||
* Extensions to wrap CharSequence to EpoxyCharSequence
|
||||
* Extensions to wrap CharSequence to EpoxyCharSequence.
|
||||
*/
|
||||
fun CharSequence.toEpoxyCharSequence() = EpoxyCharSequence(this)
|
||||
|
|
|
@ -22,7 +22,7 @@ import im.vector.lib.multipicker.entity.MultiPickerAudioType
|
|||
import im.vector.lib.multipicker.utils.toMultiPickerAudioType
|
||||
|
||||
/**
|
||||
* Audio file picker implementation
|
||||
* Audio file picker implementation.
|
||||
*/
|
||||
class AudioPicker : Picker<MultiPickerAudioType>() {
|
||||
|
||||
|
|
|
@ -28,12 +28,12 @@ import im.vector.lib.multipicker.utils.createTemporaryMediaFile
|
|||
import im.vector.lib.multipicker.utils.toMultiPickerImageType
|
||||
|
||||
/**
|
||||
* Implementation of taking a photo with Camera
|
||||
* Implementation of taking a photo with Camera.
|
||||
*/
|
||||
class CameraPicker {
|
||||
|
||||
/**
|
||||
* Start camera by using a ActivityResultLauncher
|
||||
* Start camera by using a ActivityResultLauncher.
|
||||
* @return Uri of taken photo or null if the operation is cancelled.
|
||||
*/
|
||||
fun startWithExpectingFile(context: Context, activityResultLauncher: ActivityResultLauncher<Intent>): Uri {
|
||||
|
|
|
@ -28,12 +28,12 @@ import im.vector.lib.multipicker.utils.createTemporaryMediaFile
|
|||
import im.vector.lib.multipicker.utils.toMultiPickerVideoType
|
||||
|
||||
/**
|
||||
* Implementation of taking a video with Camera
|
||||
* Implementation of taking a video with Camera.
|
||||
*/
|
||||
class CameraVideoPicker {
|
||||
|
||||
/**
|
||||
* Start camera by using a ActivityResultLauncher
|
||||
* Start camera by using a ActivityResultLauncher.
|
||||
* @return Uri of taken photo or null if the operation is cancelled.
|
||||
*/
|
||||
fun startWithExpectingFile(context: Context, activityResultLauncher: ActivityResultLauncher<Intent>): Uri {
|
||||
|
|
|
@ -26,7 +26,7 @@ import im.vector.lib.multipicker.entity.MultiPickerContactType
|
|||
import im.vector.lib.multipicker.utils.getColumnIndexOrNull
|
||||
|
||||
/**
|
||||
* Contact Picker implementation
|
||||
* Contact Picker implementation.
|
||||
*/
|
||||
class ContactPicker : Picker<MultiPickerContactType>() {
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ import im.vector.lib.multipicker.utils.toMultiPickerImageType
|
|||
import im.vector.lib.multipicker.utils.toMultiPickerVideoType
|
||||
|
||||
/**
|
||||
* Implementation of selecting any type of files
|
||||
* Implementation of selecting any type of files.
|
||||
*/
|
||||
class FilePicker : Picker<MultiPickerBaseType>() {
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import im.vector.lib.multipicker.entity.MultiPickerImageType
|
|||
import im.vector.lib.multipicker.utils.toMultiPickerImageType
|
||||
|
||||
/**
|
||||
* Image Picker implementation
|
||||
* Image Picker implementation.
|
||||
*/
|
||||
class ImagePicker : Picker<MultiPickerImageType>() {
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import im.vector.lib.multipicker.utils.toMultiPickerImageType
|
|||
import im.vector.lib.multipicker.utils.toMultiPickerVideoType
|
||||
|
||||
/**
|
||||
* Image/Video Picker implementation
|
||||
* Image/Video Picker implementation.
|
||||
*/
|
||||
class MediaPicker : Picker<MultiPickerBaseMediaType>() {
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import android.net.Uri
|
|||
import androidx.activity.result.ActivityResultLauncher
|
||||
|
||||
/**
|
||||
* Abstract class to provide all types of Pickers
|
||||
* Abstract class to provide all types of Pickers.
|
||||
*/
|
||||
abstract class Picker<T> {
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import im.vector.lib.multipicker.entity.MultiPickerVideoType
|
|||
import im.vector.lib.multipicker.utils.toMultiPickerVideoType
|
||||
|
||||
/**
|
||||
* Video Picker implementation
|
||||
* Video Picker implementation.
|
||||
*/
|
||||
class VideoPicker : Picker<MultiPickerVideoType>() {
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ package org.matrix.android.sdk.api
|
|||
interface MatrixCallback<in T> {
|
||||
|
||||
/**
|
||||
* On success method, default to no-op
|
||||
* On success method, default to no-op.
|
||||
* @param data the data successfully returned from the async function
|
||||
*/
|
||||
fun onSuccess(data: T) {
|
||||
|
@ -31,7 +31,7 @@ interface MatrixCallback<in T> {
|
|||
}
|
||||
|
||||
/**
|
||||
* On failure method, default to no-op
|
||||
* On failure method, default to no-op.
|
||||
* @param failure the failure data returned from the async function
|
||||
*/
|
||||
fun onFailure(failure: Throwable) {
|
||||
|
@ -40,6 +40,6 @@ interface MatrixCallback<in T> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Basic no op implementation
|
||||
* Basic no op implementation.
|
||||
*/
|
||||
class NoOpMatrixCallback<T> : MatrixCallback<T>
|
||||
|
|
|
@ -46,7 +46,7 @@ data class MatrixConfiguration(
|
|||
*/
|
||||
val proxy: Proxy? = null,
|
||||
/**
|
||||
* TLS versions and cipher suites limitation for unauthenticated requests
|
||||
* TLS versions and cipher suites limitation for unauthenticated requests.
|
||||
*/
|
||||
val connectionSpec: ConnectionSpec = ConnectionSpec.RESTRICTED_TLS,
|
||||
/**
|
||||
|
@ -62,7 +62,7 @@ data class MatrixConfiguration(
|
|||
*/
|
||||
val roomDisplayNameFallbackProvider: RoomDisplayNameFallbackProvider,
|
||||
/**
|
||||
* Thread messages default enable/disabled value
|
||||
* Thread messages default enable/disabled value.
|
||||
*/
|
||||
val threadMessagesEnabledDefault: Boolean = false,
|
||||
)
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package org.matrix.android.sdk.api
|
||||
|
||||
/**
|
||||
* This object define some global constants regarding the Matrix specification
|
||||
* This object define some global constants regarding the Matrix specification.
|
||||
*/
|
||||
object MatrixConstants {
|
||||
/**
|
||||
|
|
|
@ -147,7 +147,7 @@ object MatrixPatterns {
|
|||
}
|
||||
|
||||
/**
|
||||
* Extract server name from a matrix id
|
||||
* Extract server name from a matrix id.
|
||||
*
|
||||
* @param matrixId
|
||||
* @return null if not found or if matrixId is null
|
||||
|
@ -172,7 +172,7 @@ object MatrixPatterns {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return the domain form a userId
|
||||
* Return the domain form a userId.
|
||||
* Examples:
|
||||
* - "@alice:domain.org".getDomain() will return "domain.org"
|
||||
* - "@bob:domain.org:3455".getDomain() will return "domain.org:3455"
|
||||
|
|
|
@ -17,21 +17,21 @@
|
|||
package org.matrix.android.sdk.api
|
||||
|
||||
/**
|
||||
* This class contains pattern to match Matrix Url, aka mxc urls
|
||||
* This class contains pattern to match Matrix Url, aka mxc urls.
|
||||
*/
|
||||
object MatrixUrls {
|
||||
/**
|
||||
* "mxc" scheme, including "://". So "mxc://"
|
||||
* "mxc" scheme, including "://". So "mxc://".
|
||||
*/
|
||||
const val MATRIX_CONTENT_URI_SCHEME = "mxc://"
|
||||
|
||||
/**
|
||||
* Return true if the String starts with "mxc://"
|
||||
* Return true if the String starts with "mxc://".
|
||||
*/
|
||||
fun String.isMxcUrl() = startsWith(MATRIX_CONTENT_URI_SCHEME)
|
||||
|
||||
/**
|
||||
* Remove the "mxc://" prefix. No op if the String is not a Mxc URL
|
||||
* Remove the "mxc://" prefix. No op if the String is not a Mxc URL.
|
||||
*/
|
||||
fun String.removeMxcPrefix() = removePrefix(MATRIX_CONTENT_URI_SCHEME)
|
||||
}
|
||||
|
|
|
@ -40,12 +40,12 @@ interface AuthenticationService {
|
|||
suspend fun getLoginFlowOfSession(sessionId: String): LoginFlowResult
|
||||
|
||||
/**
|
||||
* Get a SSO url
|
||||
* Get a SSO url.
|
||||
*/
|
||||
fun getSsoUrl(redirectUrl: String, deviceId: String?, providerId: String?): String?
|
||||
|
||||
/**
|
||||
* Get the sign in or sign up fallback URL
|
||||
* Get the sign in or sign up fallback URL.
|
||||
*/
|
||||
fun getFallbackUrl(forSignIn: Boolean, deviceId: String?): String?
|
||||
|
||||
|
@ -64,17 +64,17 @@ interface AuthenticationService {
|
|||
fun getRegistrationWizard(): RegistrationWizard
|
||||
|
||||
/**
|
||||
* True when login and password has been sent with success to the homeserver
|
||||
* True when login and password has been sent with success to the homeserver.
|
||||
*/
|
||||
val isRegistrationStarted: Boolean
|
||||
|
||||
/**
|
||||
* Cancel pending login or pending registration
|
||||
* Cancel pending login or pending registration.
|
||||
*/
|
||||
suspend fun cancelPendingLoginOrRegistration()
|
||||
|
||||
/**
|
||||
* Reset all pending settings, including current HomeServerConnectionConfig
|
||||
* Reset all pending settings, including current HomeServerConnectionConfig.
|
||||
*/
|
||||
suspend fun reset()
|
||||
|
||||
|
@ -91,20 +91,20 @@ interface AuthenticationService {
|
|||
fun getLastAuthenticatedSession(): Session?
|
||||
|
||||
/**
|
||||
* Create a session after a SSO successful login
|
||||
* Create a session after a SSO successful login.
|
||||
*/
|
||||
suspend fun createSessionFromSso(homeServerConnectionConfig: HomeServerConnectionConfig,
|
||||
credentials: Credentials): Session
|
||||
|
||||
/**
|
||||
* Perform a wellknown request, using the domain from the matrixId
|
||||
* Perform a wellknown request, using the domain from the matrixId.
|
||||
*/
|
||||
suspend fun getWellKnownData(matrixId: String,
|
||||
homeServerConnectionConfig: HomeServerConnectionConfig?): WellknownResult
|
||||
|
||||
/**
|
||||
* Authenticate with a matrixId and a password
|
||||
* Usually call this after a successful call to getWellKnownData()
|
||||
* Authenticate with a matrixId and a password.
|
||||
* Usually call this after a successful call to getWellKnownData().
|
||||
* @param homeServerConnectionConfig the information about the homeserver and other configuration
|
||||
* @param matrixId the matrixId of the user
|
||||
* @param password the password of the account
|
||||
|
|
|
@ -20,7 +20,7 @@ import com.squareup.moshi.JsonClass
|
|||
import org.matrix.android.sdk.api.auth.data.LoginFlowTypes
|
||||
|
||||
/**
|
||||
* This class provides the authentication data by using user and password
|
||||
* This class provides the authentication data by using user and password.
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class TokenBasedAuth(
|
||||
|
|
|
@ -20,7 +20,7 @@ import com.squareup.moshi.JsonClass
|
|||
import org.matrix.android.sdk.api.auth.data.LoginFlowTypes
|
||||
|
||||
/**
|
||||
* This class provides the authentication data by using user and password
|
||||
* This class provides the authentication data by using user and password.
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class UserPasswordAuth(
|
||||
|
|
|
@ -37,7 +37,7 @@ data class Credentials(
|
|||
*/
|
||||
@Json(name = "access_token") val accessToken: String,
|
||||
/**
|
||||
* Not documented
|
||||
* Not documented.
|
||||
*/
|
||||
@Json(name = "refresh_token") val refreshToken: String?,
|
||||
/**
|
||||
|
|
|
@ -22,12 +22,12 @@ package org.matrix.android.sdk.api.auth.data
|
|||
*/
|
||||
data class SessionParams(
|
||||
/**
|
||||
* Please consider using shortcuts instead
|
||||
* Please consider using shortcuts instead.
|
||||
*/
|
||||
val credentials: Credentials,
|
||||
|
||||
/**
|
||||
* Please consider using shortcuts instead
|
||||
* Please consider using shortcuts instead.
|
||||
*/
|
||||
val homeServerConnectionConfig: HomeServerConnectionConfig,
|
||||
|
||||
|
@ -41,12 +41,12 @@ data class SessionParams(
|
|||
*/
|
||||
|
||||
/**
|
||||
* The userId of the session (Ex: "@user:domain.org")
|
||||
* The userId of the session (Ex: "@user:domain.org").
|
||||
*/
|
||||
val userId = credentials.userId
|
||||
|
||||
/**
|
||||
* The deviceId of the session (Ex: "ABCDEFGH")
|
||||
* The deviceId of the session (Ex: "ABCDEFGH").
|
||||
*/
|
||||
val deviceId = credentials.deviceId
|
||||
|
||||
|
@ -62,12 +62,12 @@ data class SessionParams(
|
|||
val homeServerUrlBase = homeServerConnectionConfig.homeServerUriBase.toString()
|
||||
|
||||
/**
|
||||
* The current homeserver host, using what has been entered by the user during login phase
|
||||
* The current homeserver host, using what has been entered by the user during login phase.
|
||||
*/
|
||||
val homeServerHost = homeServerConnectionConfig.homeServerUri.host
|
||||
|
||||
/**
|
||||
* The default identity server url if any, returned by the homeserver during login phase
|
||||
* The default identity server url if any, returned by the homeserver during login phase.
|
||||
*/
|
||||
val defaultIdentityServerUrl = homeServerConnectionConfig.identityServerUri?.toString()
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ import org.matrix.android.sdk.api.util.JsonDict
|
|||
* }
|
||||
* }
|
||||
* </pre>
|
||||
* .
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class WellKnown(
|
||||
|
|
|
@ -26,6 +26,7 @@ import com.squareup.moshi.JsonClass
|
|||
* "base_url": "https://vector.im"
|
||||
* }
|
||||
* </pre>
|
||||
* .
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class WellKnownBaseConfig(
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.matrix.android.sdk.api.util.JsonDict
|
|||
*/
|
||||
interface LoginWizard {
|
||||
/**
|
||||
* Get some information about a matrixId: displayName and avatar url
|
||||
* Get some information about a matrixId: displayName and avatar url.
|
||||
*/
|
||||
suspend fun getProfileInfo(matrixId: String): LoginProfileInfo
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ data class RegistrationFlowResponse(
|
|||
)
|
||||
|
||||
/**
|
||||
* Convert to something easier to handle on client side
|
||||
* Convert to something easier to handle on client side.
|
||||
*/
|
||||
fun RegistrationFlowResponse.toFlowResult(): FlowResult {
|
||||
// Get all the returned stages
|
||||
|
|
|
@ -32,7 +32,7 @@ const val MXCRYPTO_ALGORITHM_MEGOLM = "m.megolm.v1.aes-sha2"
|
|||
const val MXCRYPTO_ALGORITHM_MEGOLM_BACKUP = "m.megolm_backup.v1.curve25519-aes-sha2"
|
||||
|
||||
/**
|
||||
* Secured Shared Storage algorithm constant
|
||||
* Secured Shared Storage algorithm constant.
|
||||
*/
|
||||
const val SSSS_ALGORITHM_CURVE25519_AES_SHA2 = "m.secret_storage.v1.curve25519-aes-sha2"
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.matrix.android.sdk.api.session.crypto.verification.EmojiRepresentatio
|
|||
import org.matrix.android.sdk.internal.crypto.verification.getEmojiForCode
|
||||
|
||||
/**
|
||||
* Provide all the emojis used for SAS verification (for debug purpose)
|
||||
* Provide all the emojis used for SAS verification (for debug purpose).
|
||||
*/
|
||||
fun getAllVerificationEmojis(): List<EmojiRepresentation> {
|
||||
return (0..63).map { getEmojiForCode(it) }
|
||||
|
|
|
@ -24,6 +24,6 @@ fun CharSequence.ensurePrefix(prefix: CharSequence): CharSequence {
|
|||
}
|
||||
|
||||
/**
|
||||
* Append a new line and then the provided string
|
||||
* Append a new line and then the provided string.
|
||||
*/
|
||||
fun StringBuilder.appendNl(str: String) = append("\n").append(str)
|
||||
|
|
|
@ -47,7 +47,7 @@ fun Throwable.shouldBeRetried() = this is Failure.NetworkConnection ||
|
|||
isLimitExceededError()
|
||||
|
||||
/**
|
||||
* Get the retry delay in case of rate limit exceeded error, adding 100 ms, of defaultValue otherwise
|
||||
* Get the retry delay in case of rate limit exceeded error, adding 100 ms, of defaultValue otherwise.
|
||||
*/
|
||||
fun Throwable.getRetryDelay(defaultValue: Long): Long {
|
||||
return (this as? Failure.ServerError)
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
package org.matrix.android.sdk.api.failure
|
||||
|
||||
/**
|
||||
* This enum provide the reason why the SDK request an initial sync to the application
|
||||
* This enum provide the reason why the SDK request an initial sync to the application.
|
||||
*/
|
||||
enum class InitialSyncRequestReason {
|
||||
/**
|
||||
* The list of ignored users has changed, and at least one user who was ignored is not ignored anymore
|
||||
* The list of ignored users has changed, and at least one user who was ignored is not ignored anymore.
|
||||
*/
|
||||
IGNORED_USERS_LIST_CHANGE,
|
||||
}
|
||||
|
|
|
@ -28,9 +28,9 @@ import org.matrix.android.sdk.api.util.JsonDict
|
|||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class MatrixError(
|
||||
/** unique string which can be used to handle an error message */
|
||||
/** unique string which can be used to handle an error message. */
|
||||
@Json(name = "errcode") val code: String,
|
||||
/** human-readable error message */
|
||||
/** human-readable error message. */
|
||||
@Json(name = "error") val message: String,
|
||||
|
||||
// For M_CONSENT_NOT_GIVEN
|
||||
|
@ -92,19 +92,19 @@ data class MatrixError(
|
|||
/** Sent when the room alias given to the createRoom API is already in use. */
|
||||
const val M_ROOM_IN_USE = "M_ROOM_IN_USE"
|
||||
|
||||
/** (Not documented yet) */
|
||||
/** (Not documented yet). */
|
||||
const val M_BAD_PAGINATION = "M_BAD_PAGINATION"
|
||||
|
||||
/** The request was not correctly authorized. Usually due to login failures. */
|
||||
const val M_UNAUTHORIZED = "M_UNAUTHORIZED"
|
||||
|
||||
/** (Not documented yet) */
|
||||
/** (Not documented yet). */
|
||||
const val M_OLD_VERSION = "M_OLD_VERSION"
|
||||
|
||||
/** The server did not understand the request. */
|
||||
const val M_UNRECOGNIZED = "M_UNRECOGNIZED"
|
||||
|
||||
/** (Not documented yet) */
|
||||
/** (Not documented yet). */
|
||||
const val M_LOGIN_EMAIL_URL_NOT_YET = "M_LOGIN_EMAIL_URL_NOT_YET"
|
||||
|
||||
/** Authentication could not be performed on the third party identifier. */
|
||||
|
@ -122,7 +122,7 @@ data class MatrixError(
|
|||
/** The request or entity was too large. */
|
||||
const val M_TOO_LARGE = "M_TOO_LARGE"
|
||||
|
||||
/** (Not documented yet) */
|
||||
/** (Not documented yet). */
|
||||
const val M_CONSENT_NOT_GIVEN = "M_CONSENT_NOT_GIVEN"
|
||||
|
||||
/** The request cannot be completed because the homeserver has reached a resource limit imposed on it. For example,
|
||||
|
@ -176,10 +176,10 @@ data class MatrixError(
|
|||
/** The user is unable to reject an invite to join the server notices room. See the Server Notices module for more information. */
|
||||
const val M_CANNOT_LEAVE_SERVER_NOTICE_ROOM = "M_CANNOT_LEAVE_SERVER_NOTICE_ROOM"
|
||||
|
||||
/** (Not documented yet) */
|
||||
/** (Not documented yet). */
|
||||
const val M_WRONG_ROOM_KEYS_VERSION = "M_WRONG_ROOM_KEYS_VERSION"
|
||||
|
||||
/** (Not documented yet) */
|
||||
/** (Not documented yet). */
|
||||
const val M_WEAK_PASSWORD = "M_WEAK_PASSWORD"
|
||||
|
||||
/** The provided password's length is shorter than the minimum length required by the server. */
|
||||
|
|
|
@ -18,7 +18,7 @@ package org.matrix.android.sdk.api.federation
|
|||
|
||||
interface FederationService {
|
||||
/**
|
||||
* Get information about the homeserver
|
||||
* Get information about the homeserver.
|
||||
*/
|
||||
suspend fun getFederationVersion(): FederationVersion
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package org.matrix.android.sdk.api.listeners
|
||||
|
||||
/**
|
||||
* Interface to send a progress info
|
||||
* Interface to send a progress info.
|
||||
*/
|
||||
interface ProgressListener {
|
||||
/**
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package org.matrix.android.sdk.api.listeners
|
||||
|
||||
/**
|
||||
* Interface to send a progress info
|
||||
* Interface to send a progress info.
|
||||
*/
|
||||
interface StepProgressListener {
|
||||
|
||||
|
|
|
@ -36,19 +36,19 @@ sealed interface QueryStringValue {
|
|||
|
||||
enum class Case {
|
||||
/**
|
||||
* Match query sensitive to case
|
||||
* Match query sensitive to case.
|
||||
*/
|
||||
SENSITIVE,
|
||||
|
||||
/**
|
||||
* Match query insensitive to case, this only works for Latin-1 character sets
|
||||
* Match query insensitive to case, this only works for Latin-1 character sets.
|
||||
*/
|
||||
INSENSITIVE,
|
||||
|
||||
/**
|
||||
* Match query with input normalized (case insensitive)
|
||||
* Works around Realms inability to sort or filter by case for non Latin-1 character sets
|
||||
* Expects the target field to contain normalized data
|
||||
* Match query with input normalized (case insensitive).
|
||||
* Works around Realms inability to sort or filter by case for non Latin-1 character sets.
|
||||
* Expects the target field to contain normalized data.
|
||||
*
|
||||
* @see org.matrix.android.sdk.internal.util.Normalizer.normalize
|
||||
*/
|
||||
|
|
|
@ -23,19 +23,19 @@ import org.matrix.android.sdk.api.cache.CacheStrategy
|
|||
*/
|
||||
interface RawService {
|
||||
/**
|
||||
* Get a URL, either from cache or from the remote server, depending on the cache strategy
|
||||
* Get a URL, either from cache or from the remote server, depending on the cache strategy.
|
||||
*/
|
||||
suspend fun getUrl(url: String, cacheStrategy: CacheStrategy): String
|
||||
|
||||
/**
|
||||
* Specific case for the well-known file. Cache validity is 8 hours
|
||||
* Specific case for the well-known file. Cache validity is 8 hours.
|
||||
* @param domain the domain to get the .well-known file, for instance "matrix.org".
|
||||
* The URL will be "https://{domain}/.well-known/matrix/client"
|
||||
*/
|
||||
suspend fun getWellknown(domain: String): String
|
||||
|
||||
/**
|
||||
* Clear all the cache data
|
||||
* Clear all the cache data.
|
||||
*/
|
||||
suspend fun clearCache()
|
||||
}
|
||||
|
|
|
@ -72,23 +72,23 @@ interface Session {
|
|||
val coroutineDispatchers: MatrixCoroutineDispatchers
|
||||
|
||||
/**
|
||||
* The params associated to the session
|
||||
* The params associated to the session.
|
||||
*/
|
||||
val sessionParams: SessionParams
|
||||
|
||||
/**
|
||||
* The session is valid, i.e. it has a valid token so far
|
||||
* The session is valid, i.e. it has a valid token so far.
|
||||
*/
|
||||
val isOpenable: Boolean
|
||||
|
||||
/**
|
||||
* Useful shortcut to get access to the userId
|
||||
* Useful shortcut to get access to the userId.
|
||||
*/
|
||||
val myUserId: String
|
||||
get() = sessionParams.userId
|
||||
|
||||
/**
|
||||
* The sessionId
|
||||
* The sessionId.
|
||||
*/
|
||||
val sessionId: String
|
||||
|
||||
|
@ -99,16 +99,16 @@ interface Session {
|
|||
fun open()
|
||||
|
||||
/**
|
||||
* Requires a one time background sync
|
||||
* Requires a one time background sync.
|
||||
*/
|
||||
fun requireBackgroundSync()
|
||||
|
||||
/**
|
||||
* Launches infinite self rescheduling background syncs via the WorkManager
|
||||
* Launches infinite self rescheduling background syncs via the WorkManager.
|
||||
*
|
||||
* While dozing, syncs will only occur during maintenance windows
|
||||
* While dozing, syncs will only occur during maintenance windows.
|
||||
* For reliability it's recommended to also start a long running foreground service
|
||||
* along with disabling battery optimizations
|
||||
* along with disabling battery optimizations.
|
||||
*/
|
||||
fun startAutomaticBackgroundSync(timeOutInSeconds: Long, repeatDelayInSeconds: Long)
|
||||
|
||||
|
@ -125,7 +125,7 @@ interface Session {
|
|||
fun stopSync()
|
||||
|
||||
/**
|
||||
* Clear cache of the session
|
||||
* Clear cache of the session.
|
||||
*/
|
||||
suspend fun clearCache()
|
||||
|
||||
|
@ -147,7 +147,7 @@ interface Session {
|
|||
fun syncFlow(): SharedFlow<SyncResponse>
|
||||
|
||||
/**
|
||||
* This methods return true if an initial sync has been processed
|
||||
* This methods return true if an initial sync has been processed.
|
||||
*/
|
||||
fun hasAlreadySynced(): Boolean
|
||||
|
||||
|
@ -162,187 +162,187 @@ interface Session {
|
|||
fun contentUrlResolver(): ContentUrlResolver
|
||||
|
||||
/**
|
||||
* Returns the ContentUploadProgressTracker associated with the session
|
||||
* Returns the ContentUploadProgressTracker associated with the session.
|
||||
*/
|
||||
fun contentUploadProgressTracker(): ContentUploadStateTracker
|
||||
|
||||
/**
|
||||
* Returns the TypingUsersTracker associated with the session
|
||||
* Returns the TypingUsersTracker associated with the session.
|
||||
*/
|
||||
fun typingUsersTracker(): TypingUsersTracker
|
||||
|
||||
/**
|
||||
* Returns the ContentDownloadStateTracker associated with the session
|
||||
* Returns the ContentDownloadStateTracker associated with the session.
|
||||
*/
|
||||
fun contentDownloadProgressTracker(): ContentDownloadStateTracker
|
||||
|
||||
/**
|
||||
* Returns the cryptoService associated with the session
|
||||
* Returns the cryptoService associated with the session.
|
||||
*/
|
||||
fun cryptoService(): CryptoService
|
||||
|
||||
/**
|
||||
* Returns the ContentScannerService associated with the session
|
||||
* Returns the ContentScannerService associated with the session.
|
||||
*/
|
||||
fun contentScannerService(): ContentScannerService
|
||||
|
||||
/**
|
||||
* Returns the identity service associated with the session
|
||||
* Returns the identity service associated with the session.
|
||||
*/
|
||||
fun identityService(): IdentityService
|
||||
|
||||
/**
|
||||
* Returns the HomeServerCapabilities service associated with the session
|
||||
* Returns the HomeServerCapabilities service associated with the session.
|
||||
*/
|
||||
fun homeServerCapabilitiesService(): HomeServerCapabilitiesService
|
||||
|
||||
/**
|
||||
* Returns the RoomService associated with the session
|
||||
* Returns the RoomService associated with the session.
|
||||
*/
|
||||
fun roomService(): RoomService
|
||||
|
||||
/**
|
||||
* Returns the RoomDirectoryService associated with the session
|
||||
* Returns the RoomDirectoryService associated with the session.
|
||||
*/
|
||||
fun roomDirectoryService(): RoomDirectoryService
|
||||
|
||||
/**
|
||||
* Returns the GroupService associated with the session
|
||||
* Returns the GroupService associated with the session.
|
||||
*/
|
||||
fun groupService(): GroupService
|
||||
|
||||
/**
|
||||
* Returns the UserService associated with the session
|
||||
* Returns the UserService associated with the session.
|
||||
*/
|
||||
fun userService(): UserService
|
||||
|
||||
/**
|
||||
* Returns the SignOutService associated with the session
|
||||
* Returns the SignOutService associated with the session.
|
||||
*/
|
||||
fun signOutService(): SignOutService
|
||||
|
||||
/**
|
||||
* Returns the FilterService associated with the session
|
||||
* Returns the FilterService associated with the session.
|
||||
*/
|
||||
fun filterService(): FilterService
|
||||
|
||||
/**
|
||||
* Returns the PushRuleService associated with the session
|
||||
* Returns the PushRuleService associated with the session.
|
||||
*/
|
||||
fun pushRuleService(): PushRuleService
|
||||
|
||||
/**
|
||||
* Returns the PushersService associated with the session
|
||||
* Returns the PushersService associated with the session.
|
||||
*/
|
||||
fun pushersService(): PushersService
|
||||
|
||||
/**
|
||||
* Returns the EventService associated with the session
|
||||
* Returns the EventService associated with the session.
|
||||
*/
|
||||
fun eventService(): EventService
|
||||
|
||||
/**
|
||||
* Returns the TermsService associated with the session
|
||||
* Returns the TermsService associated with the session.
|
||||
*/
|
||||
fun termsService(): TermsService
|
||||
|
||||
/**
|
||||
* Returns the SyncStatusService associated with the session
|
||||
* Returns the SyncStatusService associated with the session.
|
||||
*/
|
||||
fun syncStatusService(): SyncStatusService
|
||||
|
||||
/**
|
||||
* Returns the SecureStorageService associated with the session
|
||||
* Returns the SecureStorageService associated with the session.
|
||||
*/
|
||||
fun secureStorageService(): SecureStorageService
|
||||
|
||||
/**
|
||||
* Returns the ProfileService associated with the session
|
||||
* Returns the ProfileService associated with the session.
|
||||
*/
|
||||
fun profileService(): ProfileService
|
||||
|
||||
/**
|
||||
* Returns the PresenceService associated with the session
|
||||
* Returns the PresenceService associated with the session.
|
||||
*/
|
||||
fun presenceService(): PresenceService
|
||||
|
||||
/**
|
||||
* Returns the AccountService associated with the session
|
||||
* Returns the AccountService associated with the session.
|
||||
*/
|
||||
fun accountService(): AccountService
|
||||
|
||||
/**
|
||||
* Returns the ToDeviceService associated with the session
|
||||
* Returns the ToDeviceService associated with the session.
|
||||
*/
|
||||
fun toDeviceService(): ToDeviceService
|
||||
|
||||
/**
|
||||
* Returns the EventStreamService associated with the session
|
||||
* Returns the EventStreamService associated with the session.
|
||||
*/
|
||||
fun eventStreamService(): EventStreamService
|
||||
|
||||
/**
|
||||
* Returns the widget service associated with the session
|
||||
* Returns the widget service associated with the session.
|
||||
*/
|
||||
fun widgetService(): WidgetService
|
||||
|
||||
/**
|
||||
* Returns the media service associated with the session
|
||||
* Returns the media service associated with the session.
|
||||
*/
|
||||
fun mediaService(): MediaService
|
||||
|
||||
/**
|
||||
* Returns the integration manager service associated with the session
|
||||
* Returns the integration manager service associated with the session.
|
||||
*/
|
||||
fun integrationManagerService(): IntegrationManagerService
|
||||
|
||||
/**
|
||||
* Returns the call signaling service associated with the session
|
||||
* Returns the call signaling service associated with the session.
|
||||
*/
|
||||
fun callSignalingService(): CallSignalingService
|
||||
|
||||
/**
|
||||
* Returns the file download service associated with the session
|
||||
* Returns the file download service associated with the session.
|
||||
*/
|
||||
fun fileService(): FileService
|
||||
|
||||
/**
|
||||
* Returns the permalink service associated with the session
|
||||
* Returns the permalink service associated with the session.
|
||||
*/
|
||||
fun permalinkService(): PermalinkService
|
||||
|
||||
/**
|
||||
* Returns the search service associated with the session
|
||||
* Returns the search service associated with the session.
|
||||
*/
|
||||
fun searchService(): SearchService
|
||||
|
||||
/**
|
||||
* Returns the federation service associated with the session
|
||||
* Returns the federation service associated with the session.
|
||||
*/
|
||||
fun federationService(): FederationService
|
||||
|
||||
/**
|
||||
* Returns the third party service associated with the session
|
||||
* Returns the third party service associated with the session.
|
||||
*/
|
||||
fun thirdPartyService(): ThirdPartyService
|
||||
|
||||
/**
|
||||
* Returns the space service associated with the session
|
||||
* Returns the space service associated with the session.
|
||||
*/
|
||||
fun spaceService(): SpaceService
|
||||
|
||||
/**
|
||||
* Returns the open id service associated with the session
|
||||
* Returns the open id service associated with the session.
|
||||
*/
|
||||
fun openIdService(): OpenIdService
|
||||
|
||||
/**
|
||||
* Returns the account data service associated with the session
|
||||
* Returns the account data service associated with the session.
|
||||
*/
|
||||
fun accountDataService(): SessionAccountDataService
|
||||
|
||||
/**
|
||||
* Returns the SharedSecretStorageService associated with the session
|
||||
* Returns the SharedSecretStorageService associated with the session.
|
||||
*/
|
||||
fun sharedSecretStorageService(): SharedSecretStorageService
|
||||
|
||||
|
@ -377,8 +377,8 @@ interface Session {
|
|||
/**
|
||||
* Possible cases:
|
||||
* - The access token is not valid anymore,
|
||||
* - a M_CONSENT_NOT_GIVEN error has been received from the homeserver
|
||||
* See [GlobalError] for all the possible cases
|
||||
* - a M_CONSENT_NOT_GIVEN error has been received from the homeserver;
|
||||
* See [GlobalError] for all the possible cases.
|
||||
*/
|
||||
fun onGlobalError(session: Session, globalError: GlobalError) = Unit
|
||||
}
|
||||
|
@ -386,7 +386,7 @@ interface Session {
|
|||
fun getUiaSsoFallbackUrl(authenticationSessionId: String): String
|
||||
|
||||
/**
|
||||
* Maintenance API, allows to print outs info on DB size to logcat
|
||||
* Maintenance API, allows to print outs info on DB size to logcat.
|
||||
*/
|
||||
fun logDbUsageInfo()
|
||||
}
|
||||
|
|
|
@ -21,16 +21,16 @@ import org.matrix.android.sdk.api.session.room.model.RoomSummary
|
|||
import org.matrix.android.sdk.api.session.user.model.User
|
||||
|
||||
/**
|
||||
* Get a room using the RoomService of a Session
|
||||
* Get a room using the RoomService of a Session.
|
||||
*/
|
||||
fun Session.getRoom(roomId: String): Room? = roomService().getRoom(roomId)
|
||||
|
||||
/**
|
||||
* Get a room summary using the RoomService of a Session
|
||||
* Get a room summary using the RoomService of a Session.
|
||||
*/
|
||||
fun Session.getRoomSummary(roomIdOrAlias: String): RoomSummary? = roomService().getRoomSummary(roomIdOrAlias)
|
||||
|
||||
/**
|
||||
* Get a user using the UserService of a Session
|
||||
* Get a user using the UserService of a Session.
|
||||
*/
|
||||
fun Session.getUser(userId: String): User? = userService().getUser(userId)
|
||||
|
|
|
@ -21,9 +21,8 @@ import org.matrix.android.sdk.api.session.events.model.Content
|
|||
import java.util.UUID
|
||||
|
||||
interface ToDeviceService {
|
||||
|
||||
/**
|
||||
* Send an event to a specific list of devices
|
||||
* Send an event to a specific list of devices.
|
||||
*/
|
||||
suspend fun sendToDevice(eventType: String, contentMap: MXUsersDevicesMap<Any>, txnId: String? = UUID.randomUUID().toString())
|
||||
|
||||
|
|
|
@ -26,12 +26,12 @@ import org.matrix.android.sdk.api.util.Optional
|
|||
*/
|
||||
interface SessionAccountDataService {
|
||||
/**
|
||||
* Retrieve the account data with the provided type or null if not found
|
||||
* Retrieve the account data with the provided type or null if not found.
|
||||
*/
|
||||
fun getUserAccountDataEvent(type: String): UserAccountDataEvent?
|
||||
|
||||
/**
|
||||
* Observe the account data with the provided type
|
||||
* Observe the account data with the provided type.
|
||||
*/
|
||||
fun getLiveUserAccountDataEvent(type: String): LiveData<Optional<UserAccountDataEvent>>
|
||||
|
||||
|
@ -60,7 +60,7 @@ interface SessionAccountDataService {
|
|||
fun getLiveRoomAccountDataEvents(types: Set<String>): LiveData<List<RoomAccountDataEvent>>
|
||||
|
||||
/**
|
||||
* Update the account data with the provided type and the provided account data content
|
||||
* Update the account data with the provided type and the provided account data content.
|
||||
*/
|
||||
suspend fun updateUserAccountData(type: String, content: Content)
|
||||
}
|
||||
|
|
|
@ -39,32 +39,32 @@ interface CallListener {
|
|||
fun onCallAnswerReceived(callAnswerContent: CallAnswerContent)
|
||||
|
||||
/**
|
||||
* Called when a called has been hung up
|
||||
* Called when a called has been hung up.
|
||||
*/
|
||||
fun onCallHangupReceived(callHangupContent: CallHangupContent)
|
||||
|
||||
/**
|
||||
* Called when a called has been rejected
|
||||
* Called when a called has been rejected.
|
||||
*/
|
||||
fun onCallRejectReceived(callRejectContent: CallRejectContent)
|
||||
|
||||
/**
|
||||
* Called when an answer has been selected
|
||||
* Called when an answer has been selected.
|
||||
*/
|
||||
fun onCallSelectAnswerReceived(callSelectAnswerContent: CallSelectAnswerContent)
|
||||
|
||||
/**
|
||||
* Called when a negotiation is sent
|
||||
* Called when a negotiation is sent.
|
||||
*/
|
||||
fun onCallNegotiateReceived(callNegotiateContent: CallNegotiateContent)
|
||||
|
||||
/**
|
||||
* Called when the call has been managed by an other session
|
||||
* Called when the call has been managed by an other session.
|
||||
*/
|
||||
fun onCallManagedByOtherSession(callId: String)
|
||||
|
||||
/**
|
||||
* Called when an asserted identity event is received
|
||||
* Called when an asserted identity event is received.
|
||||
*/
|
||||
fun onCallAssertedIdentityReceived(callAssertedIdentityContent: CallAssertedIdentityContent)
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ interface CallSignalingService {
|
|||
suspend fun getTurnServer(): TurnServerResponse
|
||||
|
||||
/**
|
||||
* Create an outgoing call
|
||||
* Create an outgoing call.
|
||||
*/
|
||||
fun createOutgoingCall(roomId: String, otherUserId: String, isVideoCall: Boolean): MxCall
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.matrix.android.sdk.api.session.room.model.call.EndCallReason
|
|||
|
||||
sealed class CallState {
|
||||
|
||||
/** Idle, setting up objects */
|
||||
/** Idle, setting up objects. */
|
||||
object Idle : CallState()
|
||||
|
||||
/**
|
||||
|
|
|
@ -35,7 +35,7 @@ interface MxCallDetail {
|
|||
}
|
||||
|
||||
/**
|
||||
* Define both an incoming call and on outgoing call
|
||||
* Define both an incoming call and on outgoing call.
|
||||
*/
|
||||
interface MxCall : MxCallDetail {
|
||||
|
||||
|
@ -46,13 +46,13 @@ interface MxCall : MxCallDetail {
|
|||
var state: CallState
|
||||
|
||||
/**
|
||||
* Pick Up the incoming call
|
||||
* It has no effect on outgoing call
|
||||
* Pick Up the incoming call.
|
||||
* It has no effect on outgoing call.
|
||||
*/
|
||||
fun accept(sdpString: String)
|
||||
|
||||
/**
|
||||
* SDP negotiation for media pause, hold/resume, ICE restarts and voice/video call up/downgrading
|
||||
* SDP negotiation for media pause, hold/resume, ICE restarts and voice/video call up/downgrading.
|
||||
*/
|
||||
fun negotiate(sdpString: String, type: SdpType)
|
||||
|
||||
|
@ -62,17 +62,17 @@ interface MxCall : MxCallDetail {
|
|||
fun selectAnswer()
|
||||
|
||||
/**
|
||||
* Reject an incoming call
|
||||
* Reject an incoming call.
|
||||
*/
|
||||
fun reject()
|
||||
|
||||
/**
|
||||
* End the call
|
||||
* End the call.
|
||||
*/
|
||||
fun hangUp(reason: EndCallReason? = null)
|
||||
|
||||
/**
|
||||
* Start a call
|
||||
* Start a call.
|
||||
* Send offer SDP to the other participant.
|
||||
*/
|
||||
fun offerSdp(sdpString: String)
|
||||
|
|
|
@ -29,7 +29,7 @@ interface ContentUrlResolver {
|
|||
}
|
||||
|
||||
/**
|
||||
* URL to use to upload content
|
||||
* URL to use to upload content.
|
||||
*/
|
||||
val uploadUrl: String
|
||||
|
||||
|
@ -42,7 +42,7 @@ interface ContentUrlResolver {
|
|||
fun resolveFullSize(contentUrl: String?): String?
|
||||
|
||||
/**
|
||||
* Get the ResolvedMethod to download a URL
|
||||
* Get the ResolvedMethod to download a URL.
|
||||
*
|
||||
* @param contentUrl the Matrix media content URI (in the form of "mxc://...").
|
||||
* @param elementToDecrypt Encryption data may be required if you use a content scanner
|
||||
|
|
|
@ -155,8 +155,8 @@ interface CryptoService {
|
|||
fun getIncomingRoomKeyRequestsPaged(): LiveData<PagedList<IncomingRoomKeyRequest>>
|
||||
|
||||
/**
|
||||
* Can be called by the app layer to accept a request manually
|
||||
* Use carefully as it is prone to social attacks
|
||||
* Can be called by the app layer to accept a request manually.
|
||||
* Use carefully as it is prone to social attacks.
|
||||
*/
|
||||
suspend fun manuallyAcceptRoomKeyRequest(request: IncomingRoomKeyRequest)
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ sealed class MXCryptoError : Throwable() {
|
|||
data class Base(val errorType: ErrorType,
|
||||
val technicalMessage: String,
|
||||
/**
|
||||
* Describe the error with more details
|
||||
* Describe the error with more details.
|
||||
*/
|
||||
val detailedErrorDescription: String? = null) : MXCryptoError()
|
||||
|
||||
|
@ -63,7 +63,7 @@ sealed class MXCryptoError : Throwable() {
|
|||
|
||||
companion object {
|
||||
/**
|
||||
* Resource for technicalMessage
|
||||
* Resource for technicalMessage.
|
||||
*/
|
||||
const val UNABLE_TO_ENCRYPT_REASON = "Unable to encrypt %s"
|
||||
const val UNABLE_TO_DECRYPT_REASON = "Unable to decrypt %1\$s. Algorithm: %2\$s"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package org.matrix.android.sdk.api.session.crypto
|
||||
|
||||
/**
|
||||
* This listener notifies on new Megolm sessions being created
|
||||
* This listener notifies on new Megolm sessions being created.
|
||||
*/
|
||||
interface NewSessionListener {
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ fun EncryptedFileInfo.toElementToDecrypt(): ElementToDecrypt? {
|
|||
}
|
||||
|
||||
/**
|
||||
* Represent data to decode an attachment
|
||||
* Represent data to decode an attachment.
|
||||
*/
|
||||
@Parcelize
|
||||
data class ElementToDecrypt(
|
||||
|
|
|
@ -66,7 +66,7 @@ interface CrossSigningService {
|
|||
fun markMyMasterKeyAsTrusted()
|
||||
|
||||
/**
|
||||
* Sign one of your devices and upload the signature
|
||||
* Sign one of your devices and upload the signature.
|
||||
*/
|
||||
fun trustDevice(deviceId: String,
|
||||
callback: MatrixCallback<Unit>)
|
||||
|
|
|
@ -23,7 +23,7 @@ import org.matrix.android.sdk.api.session.crypto.model.ImportRoomKeysResult
|
|||
|
||||
interface KeysBackupService {
|
||||
/**
|
||||
* Retrieve the current version of the backup from the homeserver
|
||||
* Retrieve the current version of the backup from the homeserver.
|
||||
*
|
||||
* It can be different than keysBackupVersion.
|
||||
* @param callback Asynchronous callback
|
||||
|
@ -40,12 +40,12 @@ interface KeysBackupService {
|
|||
callback: MatrixCallback<KeysVersion>)
|
||||
|
||||
/**
|
||||
* Facility method to get the total number of locally stored keys
|
||||
* Facility method to get the total number of locally stored keys.
|
||||
*/
|
||||
fun getTotalNumbersOfKeys(): Int
|
||||
|
||||
/**
|
||||
* Facility method to get the number of backed up keys
|
||||
* Facility method to get the number of backed up keys.
|
||||
*/
|
||||
fun getTotalNumbersOfBackedUpKeys(): Int
|
||||
|
||||
|
@ -68,7 +68,7 @@ interface KeysBackupService {
|
|||
callback: MatrixCallback<KeysBackupVersionTrust>)
|
||||
|
||||
/**
|
||||
* Return the current progress of the backup
|
||||
* Return the current progress of the backup.
|
||||
*/
|
||||
fun getBackupProgress(progressListener: ProgressListener)
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.matrix.android.sdk.api.session.crypto.keysbackup
|
|||
interface KeysBackupStateListener {
|
||||
|
||||
/**
|
||||
* The keys backup state has changed
|
||||
* The keys backup state has changed.
|
||||
* @param newState the new state
|
||||
*/
|
||||
fun onStateChange(newState: KeysBackupState)
|
||||
|
|
|
@ -30,8 +30,8 @@ data class KeysVersionResult(
|
|||
override val algorithm: String,
|
||||
|
||||
/**
|
||||
* algorithm-dependent data, for "m.megolm_backup.v1.curve25519-aes-sha2"
|
||||
* see [org.matrix.android.sdk.internal.crypto.keysbackup.MegolmBackupAuthData]
|
||||
* algorithm-dependent data, for "m.megolm_backup.v1.curve25519-aes-sha2".
|
||||
* @see [org.matrix.android.sdk.internal.crypto.keysbackup.MegolmBackupAuthData]
|
||||
*/
|
||||
@Json(name = "auth_data")
|
||||
override val authData: JsonDict,
|
||||
|
|
|
@ -30,7 +30,7 @@ private const val CHAR_1 = 0x01.toByte()
|
|||
private const val RECOVERY_KEY_LENGTH = 2 + 32 + 1
|
||||
|
||||
/**
|
||||
* Tell if the format of the recovery key is correct
|
||||
* Tell if the format of the recovery key is correct.
|
||||
*
|
||||
* @param recoveryKey
|
||||
* @return true if the format of the recovery key is correct
|
||||
|
@ -40,7 +40,7 @@ fun isValidRecoveryKey(recoveryKey: String?): Boolean {
|
|||
}
|
||||
|
||||
/**
|
||||
* Compute recovery key from curve25519 key
|
||||
* Compute recovery key from curve25519 key.
|
||||
*
|
||||
* @param curve25519Key
|
||||
* @return the recovery key
|
||||
|
@ -69,7 +69,7 @@ fun computeRecoveryKey(curve25519Key: ByteArray): String {
|
|||
}
|
||||
|
||||
/**
|
||||
* Please call [.isValidRecoveryKey] and ensure it returns true before calling this method
|
||||
* Please call [.isValidRecoveryKey] and ensure it returns true before calling this method.
|
||||
*
|
||||
* @param recoveryKey the recovery key
|
||||
* @return curveKey, or null in case of error
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.matrix.android.sdk.api.session.crypto.model.IncomingRoomKeyRequest
|
|||
import org.matrix.android.sdk.api.session.crypto.model.SecretShareRequest
|
||||
|
||||
/**
|
||||
* Room keys events listener
|
||||
* Room keys events listener.
|
||||
*/
|
||||
interface GossipingRequestListener {
|
||||
/**
|
||||
|
@ -31,7 +31,7 @@ interface GossipingRequestListener {
|
|||
fun onRoomKeyRequest(request: IncomingRoomKeyRequest)
|
||||
|
||||
/**
|
||||
* Returns the secret value to be shared
|
||||
* Returns the secret value to be shared.
|
||||
* @return true if is handled
|
||||
*/
|
||||
fun onSecretShareRequest(request: SecretShareRequest): Boolean
|
||||
|
|
|
@ -20,24 +20,24 @@ import com.squareup.moshi.JsonClass
|
|||
import org.matrix.android.sdk.api.interfaces.DatedObject
|
||||
|
||||
/**
|
||||
* This class describes the device information
|
||||
* This class describes the device information.
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class DeviceInfo(
|
||||
/**
|
||||
* The owner user id (not documented and useless but the homeserver sent it. You should not need it)
|
||||
* The owner user id (not documented and useless but the homeserver sent it. You should not need it).
|
||||
*/
|
||||
@Json(name = "user_id")
|
||||
val userId: String? = null,
|
||||
|
||||
/**
|
||||
* The device id
|
||||
* The device id.
|
||||
*/
|
||||
@Json(name = "device_id")
|
||||
val deviceId: String? = null,
|
||||
|
||||
/**
|
||||
* The device display name
|
||||
* The device display name.
|
||||
*/
|
||||
@Json(name = "display_name")
|
||||
val displayName: String? = null,
|
||||
|
@ -49,7 +49,7 @@ data class DeviceInfo(
|
|||
val lastSeenTs: Long? = null,
|
||||
|
||||
/**
|
||||
* The last ip address
|
||||
* The last ip address.
|
||||
*/
|
||||
@Json(name = "last_seen_ip")
|
||||
val lastSeenIp: String? = null
|
||||
|
|
|
@ -20,7 +20,7 @@ import com.squareup.moshi.Json
|
|||
import com.squareup.moshi.JsonClass
|
||||
|
||||
/**
|
||||
* In Matrix specs: EncryptedFile
|
||||
* In Matrix specs: EncryptedFile.
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class EncryptedFileInfo(
|
||||
|
@ -56,7 +56,7 @@ data class EncryptedFileInfo(
|
|||
val v: String? = null
|
||||
) {
|
||||
/**
|
||||
* Check what the spec tells us
|
||||
* Check what the spec tells us.
|
||||
*/
|
||||
fun isValid(): Boolean {
|
||||
if (url.isNullOrBlank()) {
|
||||
|
|
|
@ -52,7 +52,7 @@ data class EncryptedFileKey(
|
|||
val k: String? = null
|
||||
) {
|
||||
/**
|
||||
* Check what the spec tells us
|
||||
* Check what the spec tells us.
|
||||
*/
|
||||
fun isValid(): Boolean {
|
||||
if (alg != "A256CTR") {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package org.matrix.android.sdk.api.session.crypto.model
|
||||
|
||||
/**
|
||||
* Interface representing an room key action request
|
||||
* Interface representing an room key action request.
|
||||
* Note: this class cannot be abstract because of [org.matrix.androidsdk.core.JsonUtils.toRoomKeyShare]
|
||||
*/
|
||||
interface GossipingToDeviceObject : SendToDeviceObject {
|
||||
|
|
|
@ -23,22 +23,22 @@ import org.matrix.android.sdk.internal.util.time.Clock
|
|||
*/
|
||||
data class IncomingRoomKeyRequest(
|
||||
/**
|
||||
* The user id
|
||||
* The user id.
|
||||
*/
|
||||
val userId: String? = null,
|
||||
|
||||
/**
|
||||
* The device id
|
||||
* The device id.
|
||||
*/
|
||||
val deviceId: String? = null,
|
||||
|
||||
/**
|
||||
* The request id
|
||||
* The request id.
|
||||
*/
|
||||
val requestId: String? = null,
|
||||
|
||||
/**
|
||||
* The request body
|
||||
* The request body.
|
||||
*/
|
||||
val requestBody: RoomKeyRequestBody? = null,
|
||||
|
||||
|
@ -46,7 +46,7 @@ data class IncomingRoomKeyRequest(
|
|||
) {
|
||||
companion object {
|
||||
/**
|
||||
* Factory
|
||||
* Factory.
|
||||
*
|
||||
* @param event the event
|
||||
* @param currentTimeMillis the current time in milliseconds
|
||||
|
|
|
@ -30,7 +30,7 @@ data class MXDeviceInfo(
|
|||
val deviceId: String,
|
||||
|
||||
/**
|
||||
* the user id
|
||||
* the user id.
|
||||
*/
|
||||
@Json(name = "user_id")
|
||||
val userId: String,
|
||||
|
@ -66,7 +66,7 @@ data class MXDeviceInfo(
|
|||
val verified: Int = DEVICE_VERIFICATION_UNKNOWN
|
||||
) : Serializable {
|
||||
/**
|
||||
* Tells if the device is unknown
|
||||
* Tells if the device is unknown.
|
||||
*
|
||||
* @return true if the device is unknown
|
||||
*/
|
||||
|
|
|
@ -20,11 +20,11 @@ import org.matrix.android.sdk.api.session.events.model.Content
|
|||
|
||||
data class MXEncryptEventContentResult(
|
||||
/**
|
||||
* The encrypted event content
|
||||
* The encrypted event content.
|
||||
*/
|
||||
val eventContent: Content,
|
||||
/**
|
||||
* the event type
|
||||
* The event type.
|
||||
*/
|
||||
val eventType: String
|
||||
)
|
||||
|
|
|
@ -31,7 +31,7 @@ class MXUsersDevicesMap<E> {
|
|||
get() = map.isEmpty()
|
||||
|
||||
/**
|
||||
* Provides the device ids list for a user id
|
||||
* Provides the device ids list for a user id.
|
||||
* FIXME Should maybe return emptyList and not null, to avoid many !! in the code
|
||||
*
|
||||
* @param userId the user id
|
||||
|
@ -44,7 +44,7 @@ class MXUsersDevicesMap<E> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Provides the object for a device id and a user Id
|
||||
* Provides the object for a device id and a user Id.
|
||||
*
|
||||
* @param deviceId the device id
|
||||
* @param userId the object id
|
||||
|
@ -57,7 +57,7 @@ class MXUsersDevicesMap<E> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Set an object for a dedicated user Id and device Id
|
||||
* Set an object for a dedicated user Id and device Id.
|
||||
*
|
||||
* @param userId the user Id
|
||||
* @param deviceId the device id
|
||||
|
@ -71,7 +71,7 @@ class MXUsersDevicesMap<E> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Defines the objects map for a user Id
|
||||
* Defines the objects map for a user Id.
|
||||
*
|
||||
* @param objectsPerDevices the objects maps
|
||||
* @param userId the user id
|
||||
|
@ -87,7 +87,7 @@ class MXUsersDevicesMap<E> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Removes objects for a dedicated user
|
||||
* Removes objects for a dedicated user.
|
||||
*
|
||||
* @param userId the user id.
|
||||
*/
|
||||
|
@ -98,14 +98,14 @@ class MXUsersDevicesMap<E> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Clear the internal dictionary
|
||||
* Clear the internal dictionary.
|
||||
*/
|
||||
fun removeAllObjects() {
|
||||
map.clear()
|
||||
}
|
||||
|
||||
/**
|
||||
* Add entries from another MXUsersDevicesMap
|
||||
* Add entries from another MXUsersDevicesMap.
|
||||
*
|
||||
* @param other the other one
|
||||
*/
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.matrix.android.sdk.api.util.JsonDict
|
|||
@JsonClass(generateAdapter = true)
|
||||
data class OlmDecryptionResult(
|
||||
/**
|
||||
* The decrypted payload (with properties 'type', 'content')
|
||||
* The decrypted payload (with properties 'type', 'content').
|
||||
*/
|
||||
@Json(name = "payload") val payload: JsonDict? = null,
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.squareup.moshi.JsonClass
|
|||
import org.matrix.android.sdk.internal.di.MoshiProvider
|
||||
|
||||
/**
|
||||
* Class representing an room key request body content
|
||||
* Class representing an room key request body content.
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class RoomKeyRequestBody(
|
||||
|
|
|
@ -20,7 +20,7 @@ import com.squareup.moshi.Json
|
|||
import com.squareup.moshi.JsonClass
|
||||
|
||||
/**
|
||||
* Class representing a room key request content
|
||||
* Class representing a room key request content.
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class RoomKeyShareRequest(
|
||||
|
|
|
@ -20,7 +20,7 @@ import com.squareup.moshi.Json
|
|||
import com.squareup.moshi.JsonClass
|
||||
|
||||
/**
|
||||
* Class representing a room key request content
|
||||
* Class representing a room key request content.
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class SecretShareRequest(
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.matrix.android.sdk.internal.crypto.model.rest.VERIFICATION_METHOD_SAS
|
|||
import java.util.UUID
|
||||
|
||||
/**
|
||||
* Stores current pending verification requests
|
||||
* Stores current pending verification requests.
|
||||
*/
|
||||
data class PendingVerificationRequest(
|
||||
val ageLocalTs: Long,
|
||||
|
@ -45,7 +45,7 @@ data class PendingVerificationRequest(
|
|||
val isFinished: Boolean = isSuccessful || cancelConclusion != null
|
||||
|
||||
/**
|
||||
* SAS is supported if I support it and the other party support it
|
||||
* SAS is supported if I support it and the other party support it.
|
||||
*/
|
||||
fun isSasSupported(): Boolean {
|
||||
return requestInfo?.methods?.contains(VERIFICATION_METHOD_SAS).orFalse() &&
|
||||
|
@ -53,7 +53,7 @@ data class PendingVerificationRequest(
|
|||
}
|
||||
|
||||
/**
|
||||
* Other can show QR code if I can scan QR code and other can show QR code
|
||||
* Other can show QR code if I can scan QR code and other can show QR code.
|
||||
*/
|
||||
fun otherCanShowQrCode(): Boolean {
|
||||
return if (isIncoming) {
|
||||
|
@ -66,7 +66,7 @@ data class PendingVerificationRequest(
|
|||
}
|
||||
|
||||
/**
|
||||
* Other can scan QR code if I can show QR code and other can scan QR code
|
||||
* Other can scan QR code if I can show QR code and other can scan QR code.
|
||||
*/
|
||||
fun otherCanScanQrCode(): Boolean {
|
||||
return if (isIncoming) {
|
||||
|
|
|
@ -19,22 +19,22 @@ package org.matrix.android.sdk.api.session.crypto.verification
|
|||
interface QrCodeVerificationTransaction : VerificationTransaction {
|
||||
|
||||
/**
|
||||
* To use to display a qr code, for the other user to scan it
|
||||
* To use to display a qr code, for the other user to scan it.
|
||||
*/
|
||||
val qrCodeText: String?
|
||||
|
||||
/**
|
||||
* Call when you have scan the other user QR code
|
||||
* Call when you have scan the other user QR code.
|
||||
*/
|
||||
fun userHasScannedOtherQrCode(otherQrCodeText: String)
|
||||
|
||||
/**
|
||||
* Call when you confirm that other user has scanned your QR code
|
||||
* Call when you confirm that other user has scanned your QR code.
|
||||
*/
|
||||
fun otherUserScannedMyQrCode()
|
||||
|
||||
/**
|
||||
* Call when you do not confirm that other user has scanned your QR code
|
||||
* Call when you do not confirm that other user has scanned your QR code.
|
||||
*/
|
||||
fun otherUserDidNotScannedMyQrCode()
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ interface SasVerificationTransaction : VerificationTransaction {
|
|||
|
||||
/**
|
||||
* To be called by the client when the user has verified that
|
||||
* both short codes do match
|
||||
* both short codes do match.
|
||||
*/
|
||||
fun userHasVerifiedShortCode()
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package org.matrix.android.sdk.api.session.crypto.verification
|
||||
|
||||
/**
|
||||
* Verification methods
|
||||
* Verification methods.
|
||||
*/
|
||||
enum class VerificationMethod {
|
||||
// Use it when your application supports the SAS verification method
|
||||
|
|
|
@ -34,7 +34,7 @@ interface VerificationService {
|
|||
fun removeListener(listener: Listener)
|
||||
|
||||
/**
|
||||
* Mark this device as verified manually
|
||||
* Mark this device as verified manually.
|
||||
*/
|
||||
fun markedLocallyAsManuallyVerified(userId: String, deviceID: String)
|
||||
|
||||
|
@ -52,7 +52,7 @@ interface VerificationService {
|
|||
transactionId: String?): String?
|
||||
|
||||
/**
|
||||
* Request key verification with another user via room events (instead of the to-device API)
|
||||
* Request key verification with another user via room events (instead of the to-device API).
|
||||
*/
|
||||
fun requestKeyVerificationInDMs(methods: List<VerificationMethod>,
|
||||
otherUserId: String,
|
||||
|
@ -81,7 +81,7 @@ interface VerificationService {
|
|||
otherDeviceId: String): String
|
||||
|
||||
/**
|
||||
* Returns false if the request is unknown
|
||||
* Returns false if the request is unknown.
|
||||
*/
|
||||
fun readyPendingVerificationInDMs(methods: List<VerificationMethod>,
|
||||
otherUserId: String,
|
||||
|
@ -89,7 +89,7 @@ interface VerificationService {
|
|||
transactionId: String): Boolean
|
||||
|
||||
/**
|
||||
* Returns false if the request is unknown
|
||||
* Returns false if the request is unknown.
|
||||
*/
|
||||
fun readyPendingVerification(methods: List<VerificationMethod>,
|
||||
otherUserId: String,
|
||||
|
|
|
@ -28,7 +28,7 @@ interface VerificationTransaction {
|
|||
val isIncoming: Boolean
|
||||
|
||||
/**
|
||||
* User wants to cancel the transaction
|
||||
* User wants to cancel the transaction.
|
||||
*/
|
||||
fun cancel()
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ inline fun <reified T> Content?.toModel(catchError: Boolean = true): T? {
|
|||
}
|
||||
|
||||
/**
|
||||
* This methods is a facility method to map a model to a json Content
|
||||
* This methods is a facility method to map a model to a json Content.
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
inline fun <reified T> T.toContent(): Content {
|
||||
|
@ -123,7 +123,7 @@ data class Event(
|
|||
var ageLocalTs: Long? = null
|
||||
|
||||
/**
|
||||
* Copy all fields, including transient fields
|
||||
* Copy all fields, including transient fields.
|
||||
*/
|
||||
fun copyAll(): Event {
|
||||
return copy().also {
|
||||
|
@ -227,14 +227,14 @@ data class Event(
|
|||
}
|
||||
|
||||
/**
|
||||
* Determines whether or not current event has mentioned the user
|
||||
* Determines whether or not current event has mentioned the user.
|
||||
*/
|
||||
fun isUserMentioned(userId: String): Boolean {
|
||||
return getDecryptedValue("formatted_body")?.contains(userId) ?: false
|
||||
}
|
||||
|
||||
/**
|
||||
* Decrypt the message, or return the pure payload value if there is no encryption
|
||||
* Decrypt the message, or return the pure payload value if there is no encryption.
|
||||
*/
|
||||
private fun getDecryptedValue(key: String = "body"): String? {
|
||||
return if (isEncrypted()) {
|
||||
|
@ -247,7 +247,7 @@ data class Event(
|
|||
}
|
||||
|
||||
/**
|
||||
* Tells if the event is redacted
|
||||
* Tells if the event is redacted.
|
||||
*/
|
||||
fun isRedacted() = unsignedData?.redactedEvent != null
|
||||
|
||||
|
@ -305,7 +305,7 @@ data class Event(
|
|||
|
||||
/**
|
||||
* Return the value of "content.msgtype", if the Event type is "m.room.message"
|
||||
* and if the content has it, and if it is a String
|
||||
* and if the content has it, and if it is a String.
|
||||
*/
|
||||
fun Event.getMsgType(): String? {
|
||||
if (getClearType() != EventType.MESSAGE) return null
|
||||
|
@ -386,13 +386,13 @@ fun Event.getRelationContent(): RelationDefaultContent? {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the poll question or null otherwise
|
||||
* Returns the poll question or null otherwise.
|
||||
*/
|
||||
fun Event.getPollQuestion(): String? =
|
||||
getPollContent()?.getBestPollCreationInfo()?.question?.getBestQuestion()
|
||||
|
||||
/**
|
||||
* Returns the relation content for a specific type or null otherwise
|
||||
* Returns the relation content for a specific type or null otherwise.
|
||||
*/
|
||||
fun Event.getRelationContentForType(type: String): RelationDefaultContent? =
|
||||
getRelationContent()?.takeIf { it.type == type }
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
package org.matrix.android.sdk.api.session.events.model
|
||||
|
||||
/**
|
||||
* Constants defining known event relation types from Matrix specifications
|
||||
* Constants defining known event relation types from Matrix specifications.
|
||||
*/
|
||||
object RelationType {
|
||||
/** Lets you define an event which annotates an existing event.*/
|
||||
|
|
|
@ -20,37 +20,37 @@ import com.squareup.moshi.JsonClass
|
|||
import org.matrix.android.sdk.api.session.room.model.relation.RelationDefaultContent
|
||||
|
||||
/**
|
||||
* Class representing an encrypted event content
|
||||
* Class representing an encrypted event content.
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class EncryptedEventContent(
|
||||
|
||||
/**
|
||||
* the used algorithm
|
||||
* The used algorithm.
|
||||
*/
|
||||
@Json(name = "algorithm")
|
||||
val algorithm: String? = null,
|
||||
|
||||
/**
|
||||
* The encrypted event
|
||||
* The encrypted event.
|
||||
*/
|
||||
@Json(name = "ciphertext")
|
||||
val ciphertext: String? = null,
|
||||
|
||||
/**
|
||||
* The device id
|
||||
* The device id.
|
||||
*/
|
||||
@Json(name = "device_id")
|
||||
val deviceId: String? = null,
|
||||
|
||||
/**
|
||||
* the sender key
|
||||
* The sender key.
|
||||
*/
|
||||
@Json(name = "sender_key")
|
||||
val senderKey: String? = null,
|
||||
|
||||
/**
|
||||
* The session id
|
||||
* The session id.
|
||||
*/
|
||||
@Json(name = "session_id")
|
||||
val sessionId: String? = null,
|
||||
|
|
|
@ -19,7 +19,7 @@ import com.squareup.moshi.Json
|
|||
import com.squareup.moshi.JsonClass
|
||||
|
||||
/**
|
||||
* Class representing an encrypted event content
|
||||
* Class representing an encrypted event content.
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class EncryptionEventContent(
|
||||
|
|
|
@ -19,7 +19,7 @@ import com.squareup.moshi.Json
|
|||
import com.squareup.moshi.JsonClass
|
||||
|
||||
/**
|
||||
* Class representing an encrypted event content
|
||||
* Class representing an encrypted event content.
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class OlmEventContent(
|
||||
|
@ -30,7 +30,7 @@ data class OlmEventContent(
|
|||
val ciphertext: Map<String, Any>? = null,
|
||||
|
||||
/**
|
||||
* the sender key
|
||||
* the sender key.
|
||||
*/
|
||||
@Json(name = "sender_key")
|
||||
val senderKey: String? = null
|
||||
|
|
|
@ -20,36 +20,36 @@ import com.squareup.moshi.JsonClass
|
|||
import org.matrix.android.sdk.internal.di.MoshiProvider
|
||||
|
||||
/**
|
||||
* Class representing the OLM payload content
|
||||
* Class representing the OLM payload content.
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class OlmPayloadContent(
|
||||
/**
|
||||
* The room id
|
||||
* The room id.
|
||||
*/
|
||||
@Json(name = "room_id")
|
||||
val roomId: String? = null,
|
||||
|
||||
/**
|
||||
* The sender
|
||||
* The sender.
|
||||
*/
|
||||
@Json(name = "sender")
|
||||
val sender: String? = null,
|
||||
|
||||
/**
|
||||
* The recipient
|
||||
* The recipient.
|
||||
*/
|
||||
@Json(name = "recipient")
|
||||
val recipient: String? = null,
|
||||
|
||||
/**
|
||||
* the recipient keys
|
||||
* The recipient keys.
|
||||
*/
|
||||
@Json(name = "recipient_keys")
|
||||
val recipientKeys: Map<String, String>? = null,
|
||||
|
||||
/**
|
||||
* The keys
|
||||
* The keys.
|
||||
*/
|
||||
@Json(name = "keys")
|
||||
val keys: Map<String, String>? = null
|
||||
|
|
|
@ -19,7 +19,7 @@ import com.squareup.moshi.Json
|
|||
import com.squareup.moshi.JsonClass
|
||||
|
||||
/**
|
||||
* Class representing an sharekey content
|
||||
* Class representing an sharekey content.
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class RoomKeyContent(
|
||||
|
|
|
@ -19,7 +19,7 @@ import com.squareup.moshi.Json
|
|||
import com.squareup.moshi.JsonClass
|
||||
|
||||
/**
|
||||
* Class representing an sharekey content
|
||||
* Class representing an sharekey content.
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class RoomKeyWithHeldContent(
|
||||
|
@ -56,7 +56,7 @@ data class RoomKeyWithHeldContent(
|
|||
|
||||
/**
|
||||
* the device ID of the device sending the m.room_key.withheld message
|
||||
* MSC3735
|
||||
* MSC3735.
|
||||
*/
|
||||
@Json(name = "from_device") val fromDevice: String? = null
|
||||
|
||||
|
@ -69,23 +69,23 @@ data class RoomKeyWithHeldContent(
|
|||
|
||||
enum class WithHeldCode(val value: String) {
|
||||
/**
|
||||
* the user/device was blacklisted
|
||||
* the user/device was blacklisted.
|
||||
*/
|
||||
BLACKLISTED("m.blacklisted"),
|
||||
|
||||
/**
|
||||
* the user/devices is unverified
|
||||
* the user/devices is unverified.
|
||||
*/
|
||||
UNVERIFIED("m.unverified"),
|
||||
|
||||
/**
|
||||
* the user/device is not allowed have the key. For example, this would usually be sent in response
|
||||
* to a key request if the user was not in the room when the message was sent
|
||||
* to a key request if the user was not in the room when the message was sent.
|
||||
*/
|
||||
UNAUTHORISED("m.unauthorised"),
|
||||
|
||||
/**
|
||||
* Sent in reply to a key request if the device that the key is requested from does not have the requested key
|
||||
* Sent in reply to a key request if the device that the key is requested from does not have the requested key.
|
||||
*/
|
||||
UNAVAILABLE("m.unavailable"),
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import com.squareup.moshi.Json
|
|||
import com.squareup.moshi.JsonClass
|
||||
|
||||
/**
|
||||
* Class representing an encrypted event content
|
||||
* Class representing an encrypted event content.
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class SecretSendEventContent(
|
||||
|
|
|
@ -73,7 +73,7 @@ interface FileService {
|
|||
|
||||
/**
|
||||
* Use this URI and pass it to intent using flag Intent.FLAG_GRANT_READ_URI_PERMISSION
|
||||
* (if not other app won't be able to access it)
|
||||
* (if not other app won't be able to access it).
|
||||
*/
|
||||
fun getTemporarySharableURI(mxcUrl: String?,
|
||||
fileName: String,
|
||||
|
@ -106,17 +106,17 @@ interface FileService {
|
|||
)
|
||||
|
||||
/**
|
||||
* Clears all the files downloaded by the service, including decrypted files
|
||||
* Clears all the files downloaded by the service, including decrypted files.
|
||||
*/
|
||||
fun clearCache()
|
||||
|
||||
/**
|
||||
* Clears all the decrypted files by the service
|
||||
* Clears all the decrypted files by the service.
|
||||
*/
|
||||
fun clearDecryptedCache()
|
||||
|
||||
/**
|
||||
* Get size of cached files
|
||||
* Get size of cached files.
|
||||
*/
|
||||
fun getCacheSize(): Long
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ import androidx.core.content.FileProvider
|
|||
|
||||
/**
|
||||
* We have to declare our own file provider to avoid collision with apps using the sdk
|
||||
* and having their own
|
||||
* and having their own.
|
||||
*/
|
||||
class MatrixSDKFileProvider : FileProvider() {
|
||||
override fun getType(uri: Uri): String? {
|
||||
|
|
|
@ -23,16 +23,15 @@ import org.matrix.android.sdk.api.session.group.model.GroupSummary
|
|||
* This interface defines methods to get groups. It's implemented at the session level.
|
||||
*/
|
||||
interface GroupService {
|
||||
|
||||
/**
|
||||
* Get a group from a groupId
|
||||
* Get a group from a groupId.
|
||||
* @param groupId the groupId to look for.
|
||||
* @return the group with groupId or null
|
||||
*/
|
||||
fun getGroup(groupId: String): Group?
|
||||
|
||||
/**
|
||||
* Get a groupSummary from a groupId
|
||||
* Get a groupSummary from a groupId.
|
||||
* @param groupId the groupId to look for.
|
||||
* @return the groupSummary with groupId or null
|
||||
*/
|
||||
|
|
|
@ -24,7 +24,7 @@ fun groupSummaryQueryParams(init: (GroupSummaryQueryParams.Builder.() -> Unit) =
|
|||
}
|
||||
|
||||
/**
|
||||
* This class can be used to filter group summaries
|
||||
* This class can be used to filter group summaries.
|
||||
*/
|
||||
data class GroupSummaryQueryParams(
|
||||
val displayName: QueryStringValue,
|
||||
|
|
|
@ -34,25 +34,25 @@ data class HomeServerCapabilities(
|
|||
*/
|
||||
val canChange3pid: Boolean = true,
|
||||
/**
|
||||
* Max size of file which can be uploaded to the homeserver in bytes. [MAX_UPLOAD_FILE_SIZE_UNKNOWN] if unknown or not retrieved yet
|
||||
* Max size of file which can be uploaded to the homeserver in bytes. [MAX_UPLOAD_FILE_SIZE_UNKNOWN] if unknown or not retrieved yet.
|
||||
*/
|
||||
val maxUploadFileSize: Long = MAX_UPLOAD_FILE_SIZE_UNKNOWN,
|
||||
/**
|
||||
* Last version identity server and binding supported
|
||||
* Last version identity server and binding supported.
|
||||
*/
|
||||
val lastVersionIdentityServerSupported: Boolean = false,
|
||||
/**
|
||||
* Default identity server url, provided in Wellknown
|
||||
* Default identity server url, provided in Wellknown.
|
||||
*/
|
||||
val defaultIdentityServerUrl: String? = null,
|
||||
/**
|
||||
* Room versions supported by the server
|
||||
* Room versions supported by the server.
|
||||
* This capability describes the default and available room versions a server supports, and at what level of stability.
|
||||
* Clients should make use of this capability to determine if users need to be encouraged to upgrade their rooms.
|
||||
*/
|
||||
val roomVersions: RoomVersionCapabilities? = null,
|
||||
/**
|
||||
* True if the home server support threading
|
||||
* True if the home server support threading.
|
||||
*/
|
||||
val canUseThreading: Boolean = false
|
||||
) {
|
||||
|
|
|
@ -22,12 +22,12 @@ package org.matrix.android.sdk.api.session.homeserver
|
|||
interface HomeServerCapabilitiesService {
|
||||
|
||||
/**
|
||||
* Force a refresh of the stored data
|
||||
* Force a refresh of the stored data.
|
||||
*/
|
||||
suspend fun refreshHomeServerCapabilities()
|
||||
|
||||
/**
|
||||
* Get the HomeServer capabilities
|
||||
* Get the HomeServer capabilities.
|
||||
*/
|
||||
fun getHomeServerCapabilities(): HomeServerCapabilities
|
||||
}
|
||||
|
|
|
@ -19,13 +19,13 @@ package org.matrix.android.sdk.api.session.identity
|
|||
import org.matrix.android.sdk.api.session.identity.model.SignInvitationResult
|
||||
|
||||
/**
|
||||
* Provides access to the identity server configuration and services identity server can provide
|
||||
* Provides access to the identity server configuration and services identity server can provide.
|
||||
*/
|
||||
interface IdentityService {
|
||||
/**
|
||||
* Return the default identity server of the user, which may have been provided at login time by the homeserver,
|
||||
* or by the Well-known setup of the homeserver
|
||||
* It may be different from the current configured identity server
|
||||
* or by the Well-known setup of the homeserver.
|
||||
* It may be different from the current configured identity server.
|
||||
*/
|
||||
fun getDefaultIdentityServer(): String?
|
||||
|
||||
|
@ -35,9 +35,9 @@ interface IdentityService {
|
|||
fun getCurrentIdentityServerUrl(): String?
|
||||
|
||||
/**
|
||||
* Check if the identity server is valid
|
||||
* See https://matrix.org/docs/spec/identity_service/latest#status-check
|
||||
* Matrix Android SDK2 only supports identity server API v2
|
||||
* Check if the identity server is valid.
|
||||
* See https://matrix.org/docs/spec/identity_service/latest#status-check.
|
||||
* Matrix Android SDK2 only supports identity server API v2.
|
||||
*/
|
||||
suspend fun isValidIdentityServer(url: String)
|
||||
|
||||
|
@ -52,12 +52,12 @@ interface IdentityService {
|
|||
suspend fun setNewIdentityServer(url: String): String
|
||||
|
||||
/**
|
||||
* Disconnect (logout) from the current identity server
|
||||
* Disconnect (logout) from the current identity server.
|
||||
*/
|
||||
suspend fun disconnect()
|
||||
|
||||
/**
|
||||
* This will ask the identity server to send an email or an SMS to let the user confirm he owns the ThreePid
|
||||
* This will ask the identity server to send an email or an SMS to let the user confirm he owns the ThreePid.
|
||||
*/
|
||||
suspend fun startBindThreePid(threePid: ThreePid)
|
||||
|
||||
|
@ -67,32 +67,32 @@ interface IdentityService {
|
|||
suspend fun cancelBindThreePid(threePid: ThreePid)
|
||||
|
||||
/**
|
||||
* This will ask the identity server to send an new email or a new SMS to let the user confirm he owns the ThreePid
|
||||
* This will ask the identity server to send an new email or a new SMS to let the user confirm he owns the ThreePid.
|
||||
*/
|
||||
suspend fun sendAgainValidationCode(threePid: ThreePid)
|
||||
|
||||
/**
|
||||
* Submit the code that the identity server has sent to the user (in email or SMS)
|
||||
* Submit the code that the identity server has sent to the user (in email or SMS).
|
||||
* Once successful, you will have to call [finalizeBindThreePid]
|
||||
* @param code the code sent to the user
|
||||
*/
|
||||
suspend fun submitValidationToken(threePid: ThreePid, code: String)
|
||||
|
||||
/**
|
||||
* This will perform the actual association of ThreePid and Matrix account
|
||||
* This will perform the actual association of ThreePid and Matrix account.
|
||||
*/
|
||||
suspend fun finalizeBindThreePid(threePid: ThreePid)
|
||||
|
||||
/**
|
||||
* Unbind a threePid
|
||||
* The request will actually be done on the homeserver
|
||||
* Unbind a threePid.
|
||||
* The request will actually be done on the homeserver.
|
||||
*/
|
||||
suspend fun unbindThreePid(threePid: ThreePid)
|
||||
|
||||
/**
|
||||
* Search MatrixId of users providing email and phone numbers
|
||||
* Note the the user consent has to be set to true, or it will throw a UserConsentNotProvided failure
|
||||
* Application has to explicitly ask for the user consent, and the answer can be stored using [setUserConsent]
|
||||
* Search MatrixId of users providing email and phone numbers.
|
||||
* Note the the user consent has to be set to true, or it will throw a UserConsentNotProvided failure.
|
||||
* Application has to explicitly ask for the user consent, and the answer can be stored using [setUserConsent].
|
||||
* Please see https://support.google.com/googleplay/android-developer/answer/9888076?hl=en for more details.
|
||||
*/
|
||||
suspend fun lookUp(threePids: List<ThreePid>): List<FoundThreePid>
|
||||
|
@ -115,8 +115,8 @@ interface IdentityService {
|
|||
fun setUserConsent(newValue: Boolean)
|
||||
|
||||
/**
|
||||
* Get the status of the current user's threePid
|
||||
* A lookup will be performed, but also pending binding state will be restored
|
||||
* Get the status of the current user's threePid.
|
||||
* A lookup will be performed, but also pending binding state will be restored.
|
||||
*
|
||||
* @param threePids the list of threePid the user owns (retrieved form the homeserver)
|
||||
* @return a map of ThreePid -> SharedState
|
||||
|
@ -126,7 +126,7 @@ interface IdentityService {
|
|||
/**
|
||||
* When one performs a 3pid invite and the third party identifier is unknown, the home server
|
||||
* will store the invitation in the Identity server and store some information in the room state membership event.
|
||||
* The email invite will contains the token and secret that can be used to claim the stored invitation
|
||||
* The email invite will contains the token and secret that can be used to claim the stored invitation.
|
||||
*
|
||||
* To aid clients who may not be able to perform crypto themselves,
|
||||
* the identity server offers some crypto functionality to help in accepting invitations.
|
||||
|
|
|
@ -33,7 +33,7 @@ data class SignInvitationResult(
|
|||
*/
|
||||
val signatures: Map<String, *>,
|
||||
/**
|
||||
* The token for the invitation
|
||||
* The token for the invitation.
|
||||
*/
|
||||
val token: String
|
||||
)
|
||||
|
|
|
@ -23,7 +23,7 @@ interface SyncStatusService {
|
|||
|
||||
sealed class Status {
|
||||
/**
|
||||
* For initial sync
|
||||
* For initial sync.
|
||||
*/
|
||||
abstract class InitialSyncStatus : Status()
|
||||
|
||||
|
@ -34,7 +34,7 @@ interface SyncStatusService {
|
|||
) : InitialSyncStatus()
|
||||
|
||||
/**
|
||||
* For incremental sync
|
||||
* For incremental sync.
|
||||
*/
|
||||
abstract class IncrementalSyncStatus : Status()
|
||||
|
||||
|
|
|
@ -30,17 +30,17 @@ data class IntegrationManagerConfig(
|
|||
*/
|
||||
enum class Kind {
|
||||
/**
|
||||
* Defined in UserAccountData
|
||||
* Defined in UserAccountData.
|
||||
*/
|
||||
ACCOUNT,
|
||||
|
||||
/**
|
||||
* Defined in Wellknown
|
||||
* Defined in Wellknown.
|
||||
*/
|
||||
HOMESERVER,
|
||||
|
||||
/**
|
||||
* Fallback value, hardcoded by the SDK
|
||||
* Fallback value, hardcoded by the SDK.
|
||||
*/
|
||||
DEFAULT
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ interface MediaService {
|
|||
suspend fun getRawPreviewUrl(url: String, timestamp: Long?): JsonDict
|
||||
|
||||
/**
|
||||
* Get Url Preview data from the homeserver, or from cache, depending on the cache strategy
|
||||
* Get Url Preview data from the homeserver, or from cache, depending on the cache strategy.
|
||||
* @param url The url to get the preview data from
|
||||
* @param timestamp The optional timestamp. Note that this parameter is not taken into account
|
||||
* if the data is already in cache and the cache strategy allow to use it
|
||||
|
@ -45,7 +45,7 @@ interface MediaService {
|
|||
suspend fun getPreviewUrl(url: String, timestamp: Long?, cacheStrategy: CacheStrategy): PreviewUrlData
|
||||
|
||||
/**
|
||||
* Clear the cache of all retrieved UrlPreview data
|
||||
* Clear the cache of all retrieved UrlPreview data.
|
||||
*/
|
||||
suspend fun clearCache()
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package org.matrix.android.sdk.api.session.media
|
||||
|
||||
/**
|
||||
* Facility data class to get the common field of a PreviewUrl response form the server
|
||||
* Facility data class to get the common field of a PreviewUrl response form the server.
|
||||
*
|
||||
* Example of return data for the url `https://matrix.org`:
|
||||
* <pre>
|
||||
|
|
|
@ -33,10 +33,10 @@ sealed class PermalinkData {
|
|||
val viaParameters: List<String>
|
||||
) : PermalinkData()
|
||||
|
||||
/**
|
||||
/*
|
||||
* &room_name=Team2
|
||||
&room_avatar_url=mxc:
|
||||
&inviter_name=bob
|
||||
* &room_avatar_url=mxc:
|
||||
* &inviter_name=bob
|
||||
*/
|
||||
@Parcelize
|
||||
data class RoomEmailInviteLink(
|
||||
|
|
|
@ -23,7 +23,7 @@ import timber.log.Timber
|
|||
import java.net.URLDecoder
|
||||
|
||||
/**
|
||||
* This class turns a uri to a [PermalinkData]
|
||||
* This class turns a uri to a [PermalinkData].
|
||||
* element-based domains (e.g. https://app.element.io/#/user/@chagai95:matrix.org) permalinks
|
||||
* or matrix.to permalinks (e.g. https://matrix.to/#/@chagai95:matrix.org)
|
||||
* or client permalinks (e.g. <clientPermalinkBaseUrl>user/@chagai95:matrix.org)
|
||||
|
@ -31,7 +31,7 @@ import java.net.URLDecoder
|
|||
object PermalinkParser {
|
||||
|
||||
/**
|
||||
* Turns a uri string to a [PermalinkData]
|
||||
* Turns a uri string to a [PermalinkData].
|
||||
*/
|
||||
fun parse(uriString: String): PermalinkData {
|
||||
val uri = Uri.parse(uriString)
|
||||
|
@ -39,7 +39,7 @@ object PermalinkParser {
|
|||
}
|
||||
|
||||
/**
|
||||
* Turns a uri to a [PermalinkData]
|
||||
* Turns a uri to a [PermalinkData].
|
||||
* https://github.com/matrix-org/matrix-doc/blob/master/proposals/1704-matrix.to-permalinks.md
|
||||
*/
|
||||
fun parse(uri: Uri): PermalinkData {
|
||||
|
|
|
@ -57,7 +57,7 @@ interface PermalinkService {
|
|||
fun createPermalink(id: String, forceMatrixTo: Boolean = false): String?
|
||||
|
||||
/**
|
||||
* Creates a permalink for a roomId, including the via parameters
|
||||
* Creates a permalink for a roomId, including the via parameters.
|
||||
*
|
||||
* @param roomId the room id
|
||||
* @param forceMatrixTo whether we should force using matrix.to base URL
|
||||
|
@ -79,7 +79,7 @@ interface PermalinkService {
|
|||
fun createPermalink(roomId: String, eventId: String, forceMatrixTo: Boolean = false): String
|
||||
|
||||
/**
|
||||
* Extract the linked id from the universal link
|
||||
* Extract the linked id from the universal link.
|
||||
*
|
||||
* @param url the universal link, Ex: "https://matrix.to/#/@benoit:matrix.org"
|
||||
* @return the id from the url, ex: "@benoit:matrix.org", or null if the url is not a permalink
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.matrix.android.sdk.api.session.presence.model.UserPresence
|
|||
*/
|
||||
interface PresenceService {
|
||||
/**
|
||||
* Update the presence status for the current user
|
||||
* Update the presence status for the current user.
|
||||
* @param presence the new presence state
|
||||
* @param statusMsg the status message to attach to this state
|
||||
*/
|
||||
|
|
|
@ -36,21 +36,21 @@ interface ProfileService {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return the current display name for this user
|
||||
* Return the current display name for this user.
|
||||
* @param userId the userId param to look for
|
||||
*
|
||||
*/
|
||||
suspend fun getDisplayName(userId: String): Optional<String>
|
||||
|
||||
/**
|
||||
* Update the display name for this user
|
||||
* Update the display name for this user.
|
||||
* @param userId the userId to update the display name of
|
||||
* @param newDisplayName the new display name of the user
|
||||
*/
|
||||
suspend fun setDisplayName(userId: String, newDisplayName: String)
|
||||
|
||||
/**
|
||||
* Update the avatar for this user
|
||||
* Update the avatar for this user.
|
||||
* @param userId the userId to update the avatar of
|
||||
* @param newAvatarUri the new avatar uri of the user
|
||||
* @param fileName the fileName of selected image
|
||||
|
@ -74,12 +74,12 @@ interface ProfileService {
|
|||
suspend fun getProfile(userId: String): JsonDict
|
||||
|
||||
/**
|
||||
* Get the current user 3Pids
|
||||
* Get the current user 3Pids.
|
||||
*/
|
||||
fun getThreePids(): List<ThreePid>
|
||||
|
||||
/**
|
||||
* Get the current user 3Pids Live
|
||||
* Get the current user 3Pids Live.
|
||||
* @param refreshData set to true to fetch data from the homeserver
|
||||
*/
|
||||
fun getThreePidsLive(refreshData: Boolean): LiveData<List<ThreePid>>
|
||||
|
@ -90,7 +90,7 @@ interface ProfileService {
|
|||
fun getPendingThreePids(): List<ThreePid>
|
||||
|
||||
/**
|
||||
* Get the pending 3Pids Live
|
||||
* Get the pending 3Pids Live.
|
||||
*/
|
||||
fun getPendingThreePidsLive(): LiveData<List<ThreePid>>
|
||||
|
||||
|
@ -100,18 +100,18 @@ interface ProfileService {
|
|||
suspend fun addThreePid(threePid: ThreePid)
|
||||
|
||||
/**
|
||||
* Validate a code received by text message
|
||||
* Validate a code received by text message.
|
||||
*/
|
||||
suspend fun submitSmsCode(threePid: ThreePid.Msisdn, code: String)
|
||||
|
||||
/**
|
||||
* Finalize adding a 3Pids. Call this method once the user has validated that he owns the ThreePid
|
||||
* Finalize adding a 3Pids. Call this method once the user has validated that he owns the ThreePid.
|
||||
*/
|
||||
suspend fun finalizeAddingThreePid(threePid: ThreePid,
|
||||
userInteractiveAuthInterceptor: UserInteractiveAuthInterceptor)
|
||||
|
||||
/**
|
||||
* Cancel adding a threepid. It will remove locally stored data about this ThreePid
|
||||
* Cancel adding a threepid. It will remove locally stored data about this ThreePid.
|
||||
*/
|
||||
suspend fun cancelAddingThreePid(threePid: ThreePid)
|
||||
|
||||
|
@ -121,7 +121,7 @@ interface ProfileService {
|
|||
suspend fun deleteThreePid(threePid: ThreePid)
|
||||
|
||||
/**
|
||||
* Return a User object from a userId
|
||||
* Return a User object from a userId.
|
||||
*/
|
||||
suspend fun getProfileAsUser(userId: String): User {
|
||||
return getProfile(userId).let { dict ->
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.util.UUID
|
|||
interface PushersService {
|
||||
|
||||
/**
|
||||
* Refresh pushers from server state
|
||||
* Refresh pushers from server state.
|
||||
*/
|
||||
fun refreshPushers()
|
||||
|
||||
|
@ -66,7 +66,7 @@ interface PushersService {
|
|||
append: Boolean = true)
|
||||
|
||||
/**
|
||||
* Directly ask the push gateway to send a push to this device
|
||||
* Directly ask the push gateway to send a push to this device.
|
||||
* If successful, the push gateway has accepted the request. In this case, the app should receive a Push with the provided eventId.
|
||||
* In case of error, PusherRejected will be thrown. In this case it means that the pushkey is not valid.
|
||||
*
|
||||
|
@ -81,30 +81,30 @@ interface PushersService {
|
|||
eventId: String)
|
||||
|
||||
/**
|
||||
* Remove a registered pusher
|
||||
* Remove a registered pusher.
|
||||
* @param pusher the pusher to remove, can be http or email
|
||||
*/
|
||||
suspend fun removePusher(pusher: Pusher)
|
||||
|
||||
/**
|
||||
* Remove a Http pusher by its pushkey and appId
|
||||
* Remove a Http pusher by its pushkey and appId.
|
||||
* @see addHttpPusher
|
||||
*/
|
||||
suspend fun removeHttpPusher(pushkey: String, appId: String)
|
||||
|
||||
/**
|
||||
* Remove an Email pusher
|
||||
* Remove an Email pusher.
|
||||
* @see addEmailPusher
|
||||
*/
|
||||
suspend fun removeEmailPusher(email: String)
|
||||
|
||||
/**
|
||||
* Get the current pushers, as a LiveData
|
||||
* Get the current pushers, as a LiveData.
|
||||
*/
|
||||
fun getPushersLive(): LiveData<List<Pusher>>
|
||||
|
||||
/**
|
||||
* Get the current pushers
|
||||
* Get the current pushers.
|
||||
*/
|
||||
fun getPushers(): List<Pusher>
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue