Role timeline setting (#10677)

* ロールタイムライン設定

* isRoleTimeline to isExplorable

* ポリシーではないので削除

* 型からも

* wip

* 足りてなかった説

* wip

* listはpublicを表示

* 前回の記載修正( #10671 )

---------

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
nenohi
2023-04-20 20:02:50 +09:00
committed by GitHub
parent af738d9ca9
commit 8dc60cd327
10 changed files with 39 additions and 2 deletions

View File

@@ -65,12 +65,15 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
super(meta, paramDef, async (ps, me) => {
const role = await this.rolesRepository.findOneBy({
id: ps.roleId,
isPublic: true,
});
if (role == null) {
throw new ApiError(meta.errors.noSuchRole);
}
if (!role.isExplorable) {
return [];
}
const limit = ps.limit + (ps.untilId ? 1 : 0) + (ps.sinceId ? 1 : 0); // untilIdに指定したものも含まれるため+1
const noteIdsRes = await this.redisClient.xrevrange(
`roleTimeline:${role.id}`,