Skip to content
Snippets Groups Projects
Commit c59852f8 authored by dakkar's avatar dakkar
Browse files

merge: fix: make sure mentions of local users get rendered correctly during AP delivery (!712)

View MR for information: !712



Closes #645

Approved-by: default avatarHazelnoot <acomputerdog@gmail.com>
Approved-by: default avatarMarie <github@yuugi.dev>
parents 60be692a aae7fff4
No related branches found
No related tags found
2 merge requests!733release 2024.9.1,!712fix: make sure mentions of local users get rendered correctly during AP delivery
Pipeline #1624 passed with stages
in 49 minutes and 46 seconds
......@@ -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;
......
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