Add support for new ban and delete all endpoint

This commit is contained in:
Niels Andriesse
2021-07-13 14:28:25 +10:00
parent 4e883b23e6
commit 6b7c7d1d2a
6 changed files with 42 additions and 2 deletions

View File

@@ -337,6 +337,14 @@ object OpenGroupAPIV2 {
}
}
fun banAndDeleteAll(publicKey: String, room: String, server: String): Promise<Unit, Exception> {
val parameters = mapOf( "public_key" to publicKey )
val request = Request(verb = POST, room = room, server = server, endpoint = "ban_and_delete_all", parameters = parameters)
return send(request).map {
Log.d("Loki", "Banned user: $publicKey from: $server.$room.")
}
}
fun unban(publicKey: String, room: String, server: String): Promise<Unit, Exception> {
val request = Request(verb = DELETE, room = room, server = server, endpoint = "block_list/$publicKey")
return send(request).map {