summaryrefslogtreecommitdiff
path: root/packages/backend/src/core
diff options
context:
space:
mode:
authorLaura Hausmann <laura@hausmann.dev>2024-10-24 05:43:41 +0200
committerLaura Hausmann <laura@hausmann.dev>2024-10-24 05:45:22 +0200
commit724aff6e4ea96d7645868f3c3bea7f891d8e0956 (patch)
tree07f57dc2e2ac9cb18b5bcacaf02949ddafa21023 /packages/backend/src/core
parentmerge: fix: should use invite limit cycle to calculate invite/limit (!706) (diff)
downloadsharkey-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/src/core')
-rw-r--r--packages/backend/src/core/MfmService.ts2
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;