[mastodon-client] fix local instance mentions

This commit is contained in:
Laura Hausmann 2023-07-08 02:01:02 +02:00
parent a14659f19f
commit 524c8f07ec
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -1281,6 +1281,8 @@ export default class Misskey implements MegalodonInterface {
status.mentions = (await this.getMentions(status.plain_content!, cache)).filter(p => p != null); status.mentions = (await this.getMentions(status.plain_content!, cache)).filter(p => p != null);
for (const m of status.mentions.filter((value, index, array) => array.indexOf(value) === index)) { for (const m of status.mentions.filter((value, index, array) => array.indexOf(value) === index)) {
if (m.acct == m.username)
status.content = status.content.replace(`@${m.acct}@${this.baseUrlToHost(this.baseUrl)}`, `@${m.acct}`);
status.content = status.content.replace(`@${m.acct}`, `<a href="${m.url}" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@${m.acct}</a>`); status.content = status.content.replace(`@${m.acct}`, `<a href="${m.url}" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@${m.acct}</a>`);
} }
return status; return status;