knock requests : expose api through Room
This commit is contained in:
parent
91444aee67
commit
741ae35aca
6 changed files with 134 additions and 0 deletions
|
|
@ -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).
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue