[mastodon-client] fix local instance mentions
This commit is contained in:
parent
9472248e1c
commit
2dd7bdcfa1
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user