From 89f47a76e81f99569cb2234857404299f8c28cba Mon Sep 17 00:00:00 2001 From: Ashfame Date: Mon, 27 Nov 2023 22:38:08 +0400 Subject: [PATCH 1/3] Revert "let room name be default alias if alias prefix isn't defined" This reverts commit 8806d1b0195944ed678ec93a6d9dffc70c155105. --- src/TeamSyncer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TeamSyncer.ts b/src/TeamSyncer.ts index 27e1e048..20e4dc14 100644 --- a/src/TeamSyncer.ts +++ b/src/TeamSyncer.ts @@ -618,7 +618,7 @@ export class TeamSyncer { } const aliasPrefix = this.getAliasPrefix(teamId); - const alias = aliasPrefix ? `${aliasPrefix}${channel.name.toLowerCase()}` : channel.name.toLowerCase(); + const alias = aliasPrefix ? `${aliasPrefix}${channel.name.toLowerCase()}` : undefined; let topic: undefined|string; if (channel.purpose) { topic = channel.purpose.value; From 5fe53410755ddcbe16886fe49e4279c44e4ffab6 Mon Sep 17 00:00:00 2001 From: Ashfame Date: Mon, 27 Nov 2023 22:50:16 +0400 Subject: [PATCH 2/3] add explanation for revert --- src/TeamSyncer.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/TeamSyncer.ts b/src/TeamSyncer.ts index 20e4dc14..009f287e 100644 --- a/src/TeamSyncer.ts +++ b/src/TeamSyncer.ts @@ -617,6 +617,9 @@ export class TeamSyncer { plUsers[admin] = 100; } + // Important note: default alias needs to be undefined if alias prefix isn't used + // otherwise teamsync would fail to create new room since if room alias is specified, + // it needs to have exclusive access to such rooms (configured in app service config) const aliasPrefix = this.getAliasPrefix(teamId); const alias = aliasPrefix ? `${aliasPrefix}${channel.name.toLowerCase()}` : undefined; let topic: undefined|string; From b42138a26886ab54b980d57dd1184f88ff325cd9 Mon Sep 17 00:00:00 2001 From: Ashfame Date: Tue, 28 Nov 2023 18:57:02 +0400 Subject: [PATCH 3/3] change comment as more was discovered --- src/TeamSyncer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TeamSyncer.ts b/src/TeamSyncer.ts index 009f287e..8f0ba31f 100644 --- a/src/TeamSyncer.ts +++ b/src/TeamSyncer.ts @@ -618,8 +618,8 @@ export class TeamSyncer { } // Important note: default alias needs to be undefined if alias prefix isn't used - // otherwise teamsync would fail to create new room since if room alias is specified, - // it needs to have exclusive access to such rooms (configured in app service config) + // otherwise Synapse refuses to create the room even when room alias is specified, as if it wasn't specified + // Seems like a bug but looking at Synapse's code, I couldn't find what's wrong const aliasPrefix = this.getAliasPrefix(teamId); const alias = aliasPrefix ? `${aliasPrefix}${channel.name.toLowerCase()}` : undefined; let topic: undefined|string;