summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/MfmService.ts
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2024-10-24 08:14:53 +0000
committerdakkar <dakkar@thenautilus.net>2024-10-24 08:14:53 +0000
commitff220bd3725a6f4500b706a6b6bc05161ea5ec19 (patch)
treea8ccfd9d20f4c0f591301d33f769a74f285fa28a /packages/backend/src/core/MfmService.ts
parentfix: make sure outgoing remote mentions get resolved correctly if referenced ... (diff)
parentmerge: fix: send MFM payload for notes that don't contain advanced MFM (!710) (diff)
downloadsharkey-ff220bd3725a6f4500b706a6b6bc05161ea5ec19.tar.gz
sharkey-ff220bd3725a6f4500b706a6b6bc05161ea5ec19.tar.bz2
sharkey-ff220bd3725a6f4500b706a6b6bc05161ea5ec19.zip
Merge branch 'develop' into 'fix/user-lookup-capitalization'
# Conflicts: # packages/backend/src/core/MfmService.ts
Diffstat (limited to 'packages/backend/src/core/MfmService.ts')
-rw-r--r--packages/backend/src/core/MfmService.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/backend/src/core/MfmService.ts b/packages/backend/src/core/MfmService.ts
index fe677a3b21..42676d6f98 100644
--- a/packages/backend/src/core/MfmService.ts
+++ b/packages/backend/src/core/MfmService.ts
@@ -413,7 +413,9 @@ export class MfmService {
const a = doc.createElement('a');
const { username, host, acct } = node.props;
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.setAttribute('href', remoteUserInfo
+ ? (remoteUserInfo.url ? remoteUserInfo.url : remoteUserInfo.uri)
+ : `${this.config.url}/${acct.endsWith(`@${this.config.url}`) ? acct.substring(0, acct.length - this.config.url.length - 1) : acct}`);
a.className = 'u-url mention';
a.textContent = acct;
return a;