mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 20:44:34 +00:00
allow passing user/note into convertStatus for performance
This commit is contained in:
parent
efd378f963
commit
a5857d2724
1 changed files with 3 additions and 3 deletions
|
@ -252,10 +252,10 @@ export class MastodonConverters {
|
|||
return await this.convertStatus(status, me);
|
||||
}
|
||||
|
||||
public async convertStatus(status: Entity.Status, me: MiLocalUser | null): Promise<MastodonEntity.Status> {
|
||||
public async convertStatus(status: Entity.Status, me: MiLocalUser | null, hints?: { note?: MiNote, user?: MiUser }): Promise<MastodonEntity.Status> {
|
||||
const convertedAccount = this.convertAccount(status.account);
|
||||
const note = await this.mastodonDataService.requireNote(status.id, me);
|
||||
const noteUser = await this.getUser(status.account.id);
|
||||
const note = hints?.note ?? await this.mastodonDataService.requireNote(status.id, me);
|
||||
const noteUser = hints?.user ?? note.user ?? await this.getUser(status.account.id);
|
||||
const mentionedRemoteUsers = JSON.parse(note.mentionedRemoteUsers);
|
||||
|
||||
const emojis = await this.customEmojiService.populateEmojis(note.emojis, noteUser.host ? noteUser.host : this.config.host);
|
||||
|
|
Loading…
Add table
Reference in a new issue