Skip to content

Commit

Permalink
fix: make sure outgoing remote mentions get resolved correctly if ref…
Browse files Browse the repository at this point in the history
…erenced with non-canonical casing (resolves misskey-dev#646)
  • Loading branch information
zotanmew authored and kakkokari-gtyih committed Nov 2, 2024
1 parent 224bbd4 commit 92b7453
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/backend/src/core/MfmService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ export class MfmService {
mention: (node) => {
const a = doc.createElement('a');
const { username, host, acct } = node.props;
const remoteUserInfo = mentionedRemoteUsers.find(remoteUser => remoteUser.username === username && remoteUser.host === host);
const remoteUserInfo = mentionedRemoteUsers.find(remoteUser => remoteUser.username.toLowerCase() === username.toLowerCase() && remoteUser.host?.toLowerCase() === host?.toLowerCase());
a.setAttribute('href', remoteUserInfo ? (remoteUserInfo.url ? remoteUserInfo.url : remoteUserInfo.uri) : `${this.config.url}/${acct}`);
a.className = 'u-url mention';
a.textContent = acct;
Expand Down

0 comments on commit 92b7453

Please sign in to comment.