Skip to content

Commit

Permalink
Add api functions to delete account data.
Browse files Browse the repository at this point in the history
  • Loading branch information
Onuray Sahin committed Dec 7, 2022
1 parent 6c94f1c commit d244f73
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
)
}

0 comments on commit d244f73

Please sign in to comment.