From b64c5179b86c9fb8dbdadb94929a99f72b70f173 Mon Sep 17 00:00:00 2001 From: ari melody Date: Fri, 21 Jun 2024 07:47:03 +0100 Subject: [PATCH] fixed local users' names showing up twice in mentions --- src/client/api.js | 3 +-- src/user/user.js | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/client/api.js b/src/client/api.js index 6528fd9..fe9b860 100644 --- a/src/client/api.js +++ b/src/client/api.js @@ -148,7 +148,6 @@ export async function parsePost(data, num_replies) { post.boost_count = data.reblogs_count; post.reply_count = data.replies_count; post.mentions = data.mentions; - if (data.media_attachments.length > 0) console.log(data.media_attachments); post.files = data.media_attachments; post.url = data.url; post.visibility = data.visibility; @@ -221,7 +220,7 @@ export async function parseUser(data) { if (data.acct.includes('@')) user.host = data.acct.split('@')[1]; else - user.host = data.username + '@' + Client.get().instance.host; + user.host = Client.get().instance.host; user.emojis = []; data.emojis.forEach(emoji_data => { diff --git a/src/user/user.js b/src/user/user.js index 6940309..fb48edb 100644 --- a/src/user/user.js +++ b/src/user/user.js @@ -1,3 +1,4 @@ +import { Client } from '../client/client.js'; import { parseText as parseEmojis } from '../emoji.js'; export default class User { @@ -15,7 +16,8 @@ export default class User { get mention() { let res = "@" + this.username; - if (this.host) res += "@" + this.host; + if (this.host != Client.get().instance.host) + res += "@" + this.host; return res; }