From ef14e0221bacdc42ab25223260d32491f52c6db0 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Fri, 13 Oct 2023 02:13:34 +0200 Subject: [PATCH] [backend] Ignore capitalization for remoteuserinfo in mfm-to-html --- packages/backend/src/mfm/to-html.ts | 2 +- packages/backend/src/server/api/mastodon/helpers/mfm.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/mfm/to-html.ts b/packages/backend/src/mfm/to-html.ts index 0e876f8ae..7c941892f 100644 --- a/packages/backend/src/mfm/to-html.ts +++ b/packages/backend/src/mfm/to-html.ts @@ -119,7 +119,7 @@ export function toHtml( const { username, host, acct } = node.props; const remoteUserInfo = mentionedRemoteUsers.find( (remoteUser) => - remoteUser.username === username && remoteUser.host === host, + remoteUser.username.toLowerCase() === username.toLowerCase() && remoteUser.host === host, ); a.href = remoteUserInfo ? remoteUserInfo.url diff --git a/packages/backend/src/server/api/mastodon/helpers/mfm.ts b/packages/backend/src/server/api/mastodon/helpers/mfm.ts index 1ad879654..c2d20d1db 100644 --- a/packages/backend/src/server/api/mastodon/helpers/mfm.ts +++ b/packages/backend/src/server/api/mastodon/helpers/mfm.ts @@ -140,7 +140,7 @@ export class MfmHelpers { const { username, host} = node.props; const remoteUserInfo = mentionedRemoteUsers.find( (remoteUser) => - remoteUser.username === username && remoteUser.host === host, + remoteUser.username.toLowerCase() === username.toLowerCase() && remoteUser.host === host, ); const localpart = `@${username}`; const isLocal = host === config.domain || (host == null && objectHost == null);