From 52f35409ecebf9359b8216c7d483ab247ff36acf Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Wed, 4 Sep 2024 14:01:33 +0200 Subject: [PATCH] Stabilise MSC4156 (#4381) * Stabilise MSC4156 Signed-off-by: Johannes Marbach * Add deprecation comments * Add minimum Matrix version --------- Signed-off-by: Johannes Marbach --- src/client.ts | 12 ++++-------- src/feature.ts | 4 ---- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/client.ts b/src/client.ts index 5bc6ab07120..85a4e84f8d9 100644 --- a/src/client.ts +++ b/src/client.ts @@ -4292,13 +4292,11 @@ export class MatrixClient extends TypedEventEmitter(Method.Post, url); } - let queryParams: QueryDict = {}; + const queryParams: QueryDict = {}; if (opts.viaServers) { + // server_name has been deprecated in favour of via with Matrix >1.11 (MSC4156) queryParams.server_name = opts.viaServers; queryParams.via = opts.viaServers; - if (this.canSupport.get(Feature.MigrateServerNameToVia) === ServerSupport.Unstable) { - queryParams = replaceParam("via", "org.matrix.msc4156.via", queryParams); - } } const data: IJoinRequestBody = {}; @@ -4341,13 +4339,11 @@ export class MatrixClient extends TypedEventEmitter1.11 (MSC4156) queryParams.server_name = opts.viaServers; queryParams.via = opts.viaServers; - if (this.canSupport.get(Feature.MigrateServerNameToVia) === ServerSupport.Unstable) { - queryParams = replaceParam("via", "org.matrix.msc4156.via", queryParams); - } } const body: Record = {}; diff --git a/src/feature.ts b/src/feature.ts index 47c914353bb..fc097676398 100644 --- a/src/feature.ts +++ b/src/feature.ts @@ -33,7 +33,6 @@ export enum Feature { AccountDataDeletion = "AccountDataDeletion", RelationsRecursion = "RelationsRecursion", IntentionalMentions = "IntentionalMentions", - MigrateServerNameToVia = "MigrateServerNameToVia", } type FeatureSupportCondition = { @@ -66,9 +65,6 @@ const featureSupportResolver: Record = { unstablePrefixes: ["org.matrix.msc3952_intentional_mentions"], matrixVersion: "v1.7", }, - [Feature.MigrateServerNameToVia]: { - unstablePrefixes: ["org.matrix.msc4156"], - }, }; export async function buildFeatureSupportMap(versions: IServerVersions): Promise> {