mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
knock requests : expose api through Room
This commit is contained in:
+6
@@ -24,6 +24,7 @@ import io.element.android.libraries.matrix.api.media.MediaUploadHandler
|
||||
import io.element.android.libraries.matrix.api.media.VideoInfo
|
||||
import io.element.android.libraries.matrix.api.poll.PollKind
|
||||
import io.element.android.libraries.matrix.api.room.draft.ComposerDraft
|
||||
import io.element.android.libraries.matrix.api.room.knock.KnockRequest
|
||||
import io.element.android.libraries.matrix.api.room.location.AssetType
|
||||
import io.element.android.libraries.matrix.api.room.powerlevels.MatrixRoomPowerLevels
|
||||
import io.element.android.libraries.matrix.api.room.powerlevels.UserRoleChange
|
||||
@@ -56,6 +57,11 @@ interface MatrixRoom : Closeable {
|
||||
val roomTypingMembersFlow: Flow<List<UserId>>
|
||||
val identityStateChangesFlow: Flow<List<IdentityStateChange>>
|
||||
|
||||
/**
|
||||
* The current knock requests in the room as a Flow.
|
||||
*/
|
||||
val knockRequestsFlow: Flow<List<KnockRequest>>
|
||||
|
||||
/**
|
||||
* A one-to-one is a room with exactly 2 members.
|
||||
* See [the Matrix spec](https://spec.matrix.org/latest/client-server-api/#default-underride-rules).
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2024 New Vector Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
* Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.libraries.matrix.api.room.knock
|
||||
|
||||
import io.element.android.libraries.matrix.api.core.UserId
|
||||
|
||||
interface KnockRequest {
|
||||
val userId: UserId
|
||||
val displayName: String?
|
||||
val avatarUrl: String?
|
||||
val reason: String?
|
||||
val timestamp: Long?
|
||||
|
||||
suspend fun accept(): Result<Unit>
|
||||
|
||||
suspend fun decline(reason: String?): Result<Unit>
|
||||
|
||||
suspend fun declineAndBan(reason: String?): Result<Unit>
|
||||
|
||||
suspend fun markAsSeen(): Result<Unit>
|
||||
}
|
||||
Reference in New Issue
Block a user