From 0c3ea4f92333c3c8412e1d4a990366bb3ef6d9e3 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sun, 12 Jun 2022 15:05:15 +0200 Subject: [PATCH 1/4] Use stable endpoint for alias management This increases compatibility with homeservers and allows them to remove Element Android specific workaround. fixes #4830 see https://github.com/ruma/ruma/pull/936 see https://github.com/matrix-org/synapse/issues/8334 see https://github.com/matrix-org/synapse/pull/9224 Signed-off-by: Nicolas Werner --- .../org/matrix/android/sdk/internal/session/room/RoomAPI.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ac2880de69..9bcb7b8e4c 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 @@ -377,7 +377,7 @@ internal interface RoomAPI { * Get a list of aliases maintained by the local server for the given room. * Ref: https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-client-r0-rooms-roomid-aliases */ - @GET(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "org.matrix.msc2432/rooms/{roomId}/aliases") + @GET(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/aliases") suspend fun getAliases(@Path("roomId") roomId: String): GetAliasesResponse /** From a7bb0efc9305cf355c0941bc28c08697d00cf86a Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sun, 12 Jun 2022 15:13:27 +0200 Subject: [PATCH 2/4] Add changelog Signed-off-by: Nicolas Werner --- changelog.d/6288.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/6288.bugfix diff --git a/changelog.d/6288.bugfix b/changelog.d/6288.bugfix new file mode 100644 index 0000000000..fc01597ed8 --- /dev/null +++ b/changelog.d/6288.bugfix @@ -0,0 +1 @@ +Use stable endpoint for alias management instead of MSC2432. Contributed by Nico. From d07557a5ee87dca0c5b8e2ea73d0de22df6ba9c8 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sun, 12 Jun 2022 18:05:17 +0200 Subject: [PATCH 3/4] Fix overlooked path as well Signed-off-by: Nicolas Werner --- .../src/main/java/org/matrix/android/sdk/api/network/ApiPath.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/network/ApiPath.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/network/ApiPath.kt index baf33a59c5..f5e5628566 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/network/ApiPath.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/network/ApiPath.kt @@ -162,7 +162,7 @@ enum class ApiPath(val path: String, val method: String) { KICK_USER(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/kick", "POST"), REDACT_EVENT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/redact/{eventId}/{txnId}", "PUT"), REPORT_CONTENT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/report/{eventId}", "POST"), - GET_ALIASES(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "org.matrix.msc2432/rooms/{roomId}/aliases", "GET"), + GET_ALIASES(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/aliases", "GET"), SEND_TYPING_STATE(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/typing/{userId}", "PUT"), PUT_TAG(NetworkConstants.URI_API_PREFIX_PATH_R0 + "user/{userId}/rooms/{roomId}/tags/{tag}", "PUT"), DELETE_TAG(NetworkConstants.URI_API_PREFIX_PATH_R0 + "user/{userId}/rooms/{roomId}/tags/{tag}", "DELETE"), From 75a698677096e83dd671957e27c5b9ebb5728acb Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Mon, 13 Jun 2022 09:57:33 +0200 Subject: [PATCH 4/4] Remove comment referencing msc2432 Signed-off-by: Nicolas Werner --- .../sdk/internal/session/room/alias/GetRoomLocalAliasesTask.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/alias/GetRoomLocalAliasesTask.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/alias/GetRoomLocalAliasesTask.kt index 1ff4156ed3..62681c89d8 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/alias/GetRoomLocalAliasesTask.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/alias/GetRoomLocalAliasesTask.kt @@ -34,7 +34,6 @@ internal class DefaultGetRoomLocalAliasesTask @Inject constructor( ) : GetRoomLocalAliasesTask { override suspend fun execute(params: GetRoomLocalAliasesTask.Params): List { - // We do not check for "org.matrix.msc2432", so the API may be missing val response = executeRequest(globalErrorReceiver) { roomAPI.getAliases(roomId = params.roomId) }