From 94f5b78b6b7eaa4f33db196c57e4f031463cb075 Mon Sep 17 00:00:00 2001 From: riku6460 <17585784+riku6460@users.noreply.github.com> Date: Sun, 9 Apr 2023 02:59:50 +0900 Subject: [PATCH] =?UTF-8?q?13.11.0=20=E3=83=9E=E3=83=BC=E3=82=B8=E6=99=82?= =?UTF-8?q?=E3=81=AE=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/misc/id/aid.ts | 4 ++-- packages/backend/src/server/api/endpoints/notes/timeline.ts | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/misc/id/aid.ts b/packages/backend/src/misc/id/aid.ts index b69cc0c4f1..93a9929aa7 100644 --- a/packages/backend/src/misc/id/aid.ts +++ b/packages/backend/src/misc/id/aid.ts @@ -6,7 +6,7 @@ import * as crypto from 'node:crypto'; const TIME2000 = 946684800000; let counter = crypto.randomBytes(2).readUInt16LE(0); -export function getTimeId(time: number): string { +function getTime(time: number): string { time = time - TIME2000; if (time < 0) time = 0; @@ -21,7 +21,7 @@ export function genAid(date: Date): string { const t = date.getTime(); if (isNaN(t)) throw 'Failed to create AID: Invalid Date'; counter++; - return getTimeId(t) + getNoise(); + return getTime(t) + getNoise(); } export function parseAid(id: string): { date: Date; } { diff --git a/packages/backend/src/server/api/endpoints/notes/timeline.ts b/packages/backend/src/server/api/endpoints/notes/timeline.ts index 7eea1d850f..dc894ea463 100644 --- a/packages/backend/src/server/api/endpoints/notes/timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/timeline.ts @@ -65,7 +65,6 @@ export default class extends Endpoint { .where('following.followerId = :followerId', { followerId: me.id }) .getMany(); - const minId = getTimeId(new Date(Date.now() - (1000 * 60 * 60 * 24 * 30)).getTime()) + '00'; // 30日前まで //#region Construct query const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)