凍結されたユーザーが含まれている場合一部の機能が誤動作する不具合を修正 (MisskeyIO#161)
z-6561
This commit is contained in:
parent
58bbff3738
commit
545ab80363
|
@ -64,4 +64,17 @@ export class NoteReactionEntityService implements OnModuleInit {
|
||||||
} : {}),
|
} : {}),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@bindThis
|
||||||
|
public async packMany(
|
||||||
|
reactions: (MiNoteReaction['id'] | MiNoteReaction)[],
|
||||||
|
me: { id: MiUser['id'] } | null | undefined,
|
||||||
|
options?: {
|
||||||
|
withNote: boolean;
|
||||||
|
},
|
||||||
|
) : Promise<Packed<'NoteReaction'>[]> {
|
||||||
|
return (await Promise.allSettled(reactions.map(x => this.pack(x, me, options))))
|
||||||
|
.filter(result => result.status === 'fulfilled')
|
||||||
|
.map(result => (result as PromiseFulfilledResult<Packed<'NoteReaction'>>).value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
folderId: ps.folderId ?? IsNull(),
|
folderId: ps.folderId ?? IsNull(),
|
||||||
});
|
});
|
||||||
|
|
||||||
return await Promise.all(files.map(file => this.driveFileEntityService.pack(file, me, { self: true })));
|
return await this.driveFileEntityService.packMany(files, me, { self: true });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
relations: ['user', 'note'],
|
relations: ['user', 'note'],
|
||||||
});
|
});
|
||||||
|
|
||||||
return await Promise.all(reactions.map(reaction => this.noteReactionEntityService.pack(reaction, me)));
|
return await this.noteReactionEntityService.packMany(reactions, me);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
.limit(ps.limit)
|
.limit(ps.limit)
|
||||||
.getMany();
|
.getMany();
|
||||||
|
|
||||||
return await Promise.all(reactions.map(reaction => this.noteReactionEntityService.pack(reaction, me, { withNote: true })));
|
return await this.noteReactionEntityService.packMany(reactions, me, { withNote: true });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,12 +113,13 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
// リクエストされた通りに並べ替え
|
// リクエストされた通りに並べ替え
|
||||||
const _users: MiUser[] = [];
|
const _users: MiUser[] = [];
|
||||||
for (const id of ps.userIds) {
|
for (const id of ps.userIds) {
|
||||||
_users.push(users.find(x => x.id === id)!);
|
const user = users.find((u) => u.id === id);
|
||||||
|
if (user) _users.push(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
return await Promise.all(_users.map(u => this.userEntityService.pack(u, me, {
|
return await this.userEntityService.packMany(_users, me, {
|
||||||
detail: true,
|
detail: true,
|
||||||
})));
|
});
|
||||||
} else {
|
} else {
|
||||||
// Lookup user
|
// Lookup user
|
||||||
if (typeof ps.host === 'string' && typeof ps.username === 'string') {
|
if (typeof ps.host === 'string' && typeof ps.username === 'string') {
|
||||||
|
|
Loading…
Reference in New Issue