From fafc1232deee5f730fba1ae0a7223a2ac88fafb3 Mon Sep 17 00:00:00 2001
From: Taras Smakula <tarassmakula@gmail.com>
Date: Tue, 3 Jan 2023 15:28:52 +0200
Subject: [PATCH] Added knock to room api

---
 .../matrix/android/sdk/internal/session/room/RoomAPI.kt    | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/RoomAPI.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/RoomAPI.kt
index 31bed90b..40bb604c 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/RoomAPI.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/RoomAPI.kt
@@ -32,6 +32,7 @@ import org.matrix.android.sdk.internal.session.room.create.JoinRoomResponse
 import org.matrix.android.sdk.internal.session.room.membership.RoomMembersResponse
 import org.matrix.android.sdk.internal.session.room.membership.admin.UserIdAndReason
 import org.matrix.android.sdk.internal.session.room.membership.joining.InviteBody
+import org.matrix.android.sdk.internal.session.room.membership.joining.KnockBody
 import org.matrix.android.sdk.internal.session.room.membership.threepid.ThreePidInviteBody
 import org.matrix.android.sdk.internal.session.room.read.ReadBody
 import org.matrix.android.sdk.internal.session.room.relation.RelationsResponse
@@ -451,4 +452,10 @@ internal interface RoomAPI {
             @Path("roomIdOrAlias") roomidOrAlias: String,
             @Query("via") viaServers: List<String>?
     ): RoomStrippedState
+
+    @POST(NetworkConstants.URI_API_PREFIX_PATH_R0 + "knock/{roomIdOrAlias}")
+    suspend fun knock(
+            @Path("roomIdOrAlias") roomIdOrAlias: String,
+            @Body body: KnockBody
+    )
 }
-- 
GitLab