Skip to content

Commit 0e9757a

Browse files
authored
Merge pull request #28 from Automattic/teamsync_new_room_fix
Teamsync fix to dynamically create rooms
2 parents d4b2383 + b42138a commit 0e9757a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/TeamSyncer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,8 +617,11 @@ export class TeamSyncer {
617617
plUsers[admin] = 100;
618618
}
619619

620+
// Important note: default alias needs to be undefined if alias prefix isn't used
621+
// otherwise Synapse refuses to create the room even when room alias is specified, as if it wasn't specified
622+
// Seems like a bug but looking at Synapse's code, I couldn't find what's wrong
620623
const aliasPrefix = this.getAliasPrefix(teamId);
621-
const alias = aliasPrefix ? `${aliasPrefix}${channel.name.toLowerCase()}` : channel.name.toLowerCase();
624+
const alias = aliasPrefix ? `${aliasPrefix}${channel.name.toLowerCase()}` : undefined;
622625
let topic: undefined|string;
623626
if (channel.purpose) {
624627
topic = channel.purpose.value;

0 commit comments

Comments
 (0)