Add api functions to delete account data.

This commit is contained in:
Onuray Sahin 2022-12-07 18:12:25 +03:00
parent 6c94f1cd52
commit d244f7324c
2 changed files with 26 additions and 0 deletions

View file

@ -427,6 +427,19 @@ internal interface RoomAPI {
@Body content: JsonDict
)
/**
* Remove an account_data event from the room.
* @param userId the user id
* @param roomId the room id
* @param type the type
*/
@DELETE(NetworkConstants.URI_API_PREFIX_PATH_MEDIA_PROXY_UNSTABLE + "org.matrix.msc3391/user/{userId}/rooms/{roomId}/account_data/{type}")
suspend fun deleteRoomAccountData(
@Path("userId") userId: String,
@Path("roomId") roomId: String,
@Path("type") type: String
)
/**
* Upgrades the given room to a particular room version.
* Errors:

View file

@ -18,6 +18,7 @@ package org.matrix.android.sdk.internal.session.user.accountdata
import org.matrix.android.sdk.internal.network.NetworkConstants
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.PUT
import retrofit2.http.Path
@ -36,4 +37,16 @@ internal interface AccountDataAPI {
@Path("type") type: String,
@Body params: Any
)
/**
* Remove an account_data for the client.
*
* @param userId the user id
* @param type the type
*/
@DELETE(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "org.matrix.msc3391/user/{userId}/account_data/{type}")
suspend fun deleteAccountData(
@Path("userId") userId: String,
@Path("type") type: String
)
}