Skip to content

Commit

Permalink
lowercase matrix ID localparts
Browse files Browse the repository at this point in the history
  • Loading branch information
kbleeke committed Sep 24, 2023
1 parent 30e5810 commit 513337f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/irc/IrcServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ export class IrcServer {
return renderTemplate(this.config.matrixClients.userTemplate, {
server: this.domain,
nick,
}).substring(1); // the first character is guaranteed by config schema to be '@'
}).substring(1).toLowerCase(); // the first character is guaranteed by config schema to be '@'
}

public claimsUserId(userId: string): boolean {
Expand Down Expand Up @@ -586,9 +586,7 @@ export class IrcServer {
}

public getUserIdFromNick(nick: string): string {
const template = this.config.matrixClients.userTemplate;
return template.replace(/\$NICK/g, nick).replace(/\$SERVER/g, this.domain) +
":" + this.homeserverDomain;
return "@" + this.getUserLocalpart(nick) + ":" + this.homeserverDomain;
}

public getDisplayNameFromNick(nick: string): string {
Expand Down

0 comments on commit 513337f

Please sign in to comment.