summaryrefslogtreecommitdiff
path: root/packages/backend
diff options
context:
space:
mode:
authorLaura Hausmann <laura@hausmann.dev>2024-10-24 05:51:30 +0200
committerLaura Hausmann <laura@hausmann.dev>2024-10-24 05:51:30 +0200
commitaae7fff4949cf4b042cf145497d1e1e5a7a76dbf (patch)
tree4e92d9bfee0dc1d8882b65fb5b55ba2cbcb07fd9 /packages/backend
parentmerge: fix: should use invite limit cycle to calculate invite/limit (!706) (diff)
downloadsharkey-aae7fff4949cf4b042cf145497d1e1e5a7a76dbf.tar.gz
sharkey-aae7fff4949cf4b042cf145497d1e1e5a7a76dbf.tar.bz2
sharkey-aae7fff4949cf4b042cf145497d1e1e5a7a76dbf.zip
fix: make sure mentions of local users get rendered correctly during AP delivery (resolves #645)
Diffstat (limited to 'packages/backend')
-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 2055ea7f37..2200aeecea 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 === username && remoteUser.host === host);
- 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;