diff options
| author | Laura Hausmann <laura@hausmann.dev> | 2024-10-24 05:43:41 +0200 |
|---|---|---|
| committer | Laura Hausmann <laura@hausmann.dev> | 2024-10-24 05:45:22 +0200 |
| commit | 724aff6e4ea96d7645868f3c3bea7f891d8e0956 (patch) | |
| tree | 07f57dc2e2ac9cb18b5bcacaf02949ddafa21023 /packages/backend | |
| parent | merge: fix: should use invite limit cycle to calculate invite/limit (!706) (diff) | |
| download | sharkey-724aff6e4ea96d7645868f3c3bea7f891d8e0956.tar.gz sharkey-724aff6e4ea96d7645868f3c3bea7f891d8e0956.tar.bz2 sharkey-724aff6e4ea96d7645868f3c3bea7f891d8e0956.zip | |
fix: make sure outgoing remote mentions get resolved correctly if referenced with non-canonical casing (resolves #646)
Diffstat (limited to 'packages/backend')
| -rw-r--r-- | packages/backend/src/core/MfmService.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/backend/src/core/MfmService.ts b/packages/backend/src/core/MfmService.ts index 2055ea7f37..fe677a3b21 100644 --- a/packages/backend/src/core/MfmService.ts +++ b/packages/backend/src/core/MfmService.ts @@ -412,7 +412,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; |