Skip to content
Snippets Groups Projects
Unverified Commit aae7fff4 authored by Laura Hausmann's avatar Laura Hausmann
Browse files

fix: make sure mentions of local users get rendered correctly during AP delivery (resolves #645)

parent 60be692a
No related branches found
Tags 13.2.6
2 merge requests!733release 2024.9.1,!712fix: make sure mentions of local users get rendered correctly during AP delivery
...@@ -413,7 +413,9 @@ export class MfmService { ...@@ -413,7 +413,9 @@ export class MfmService {
const a = doc.createElement('a'); const a = doc.createElement('a');
const { username, host, acct } = node.props; const { username, host, acct } = node.props;
const remoteUserInfo = mentionedRemoteUsers.find(remoteUser => remoteUser.username === username && remoteUser.host === host); 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.className = 'u-url mention';
a.textContent = acct; a.textContent = acct;
return a; return a;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment