[mastodon-client] Skip processing mentions of deleted users
This commit is contained in:
parent
8e3e2440b8
commit
0d8fe856aa
1 changed files with 6 additions and 1 deletions
|
|
@ -68,6 +68,11 @@ export class NoteConverter {
|
||||||
|
|
||||||
const files = await DriveFiles.packMany(note.fileIds);
|
const files = await DriveFiles.packMany(note.fileIds);
|
||||||
|
|
||||||
|
const mentions = note.mentions.map(async p =>
|
||||||
|
await getUser(p)
|
||||||
|
.then(u => MentionConverter.encode(u))
|
||||||
|
.catch(() => null));
|
||||||
|
|
||||||
// FIXME use await-all
|
// FIXME use await-all
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
@ -95,7 +100,7 @@ export class NoteConverter {
|
||||||
spoiler_text: note.cw ? note.cw : "",
|
spoiler_text: note.cw ? note.cw : "",
|
||||||
visibility: VisibilityConverter.encode(note.visibility),
|
visibility: VisibilityConverter.encode(note.visibility),
|
||||||
media_attachments: files.length > 0 ? files.map((f) => FileConverter.encode(f)) : [],
|
media_attachments: files.length > 0 ? files.map((f) => FileConverter.encode(f)) : [],
|
||||||
mentions: await Promise.all(note.mentions.map(async p => MentionConverter.encode(await getUser(p)))),
|
mentions: (await Promise.all(mentions)).filter(p => p) as MastodonEntity.Mention[],
|
||||||
tags: [], //FIXME
|
tags: [], //FIXME
|
||||||
card: null, //FIXME
|
card: null, //FIXME
|
||||||
poll: note.hasPoll ? PollConverter.encode(await populatePoll(note, user?.id ?? null), note.id) : null,
|
poll: note.hasPoll ? PollConverter.encode(await populatePoll(note, user?.id ?? null), note.id) : null,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue