forked from misskey-dev/misskey
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 노트 게시를 예약할 수 있음 (yojo-art/cherrypick#483, [Type4ny-Project/Type…
…4ny@271c872c](Type4ny-Project@271c872)) (cherry picked from commit 4d8512388e8f56c6c687b6fca069e789cbc10ae5) Co-Authored-By: mattyatea <mattyacocacora0@gmail.com> Co-Authored-By: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Co-Authored-By: kozakura913 <98575220+kozakura913@users.noreply.github.com>
- Loading branch information
1 parent
6718a54
commit 619d404
Showing
41 changed files
with
1,461 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* SPDX-FileCopyrightText: syuilo and misskey-project | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
*/ | ||
|
||
export class ScheduleNote1699437894737 { | ||
name = 'ScheduleNote1699437894737' | ||
|
||
async up(queryRunner) { | ||
await queryRunner.query(`CREATE TABLE "note_schedule" ("id" character varying(32) NOT NULL, "note" jsonb NOT NULL, "userId" character varying(260) NOT NULL, "scheduledAt" TIMESTAMP WITH TIME ZONE NOT NULL, CONSTRAINT "PK_3a1ae2db41988f4994268218436" PRIMARY KEY ("id"))`); | ||
await queryRunner.query(`CREATE INDEX "IDX_e798958c40009bf0cdef4f28b5" ON "note_schedule" ("userId") `); | ||
} | ||
|
||
async down(queryRunner) { | ||
await queryRunner.query(`DROP TABLE "note_schedule"`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* SPDX-FileCopyrightText: syuilo and other misskey contributors | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
*/ | ||
|
||
import { Entity, Index, Column, PrimaryColumn } from 'typeorm'; | ||
import { MiNote } from '@/models/Note.js'; | ||
import { id } from './util/id.js'; | ||
import { MiUser } from './User.js'; | ||
import { MiChannel } from './Channel.js'; | ||
import type { MiDriveFile } from './DriveFile.js'; | ||
|
||
type MinimumUser = { | ||
id: MiUser['id']; | ||
host: MiUser['host']; | ||
username: MiUser['username']; | ||
uri: MiUser['uri']; | ||
}; | ||
|
||
export type MiScheduleNoteType={ | ||
/** Date.toISOString() */ | ||
createdAt: string; | ||
visibility: 'public' | 'home' | 'followers' | 'specified'; | ||
visibleUsers: MinimumUser[]; | ||
channel?: MiChannel['id']; | ||
poll: { | ||
multiple: boolean; | ||
choices: string[]; | ||
/** Date.toISOString() */ | ||
expiresAt: string | null | ||
} | undefined; | ||
renote?: MiNote['id']; | ||
localOnly: boolean; | ||
cw?: string | null; | ||
reactionAcceptance: 'likeOnly' | 'likeOnlyForRemote' | 'nonSensitiveOnly' | 'nonSensitiveOnlyForLocalLikeOnlyForRemote' | null; | ||
files: MiDriveFile['id'][]; | ||
text?: string | null; | ||
reply?: MiNote['id']; | ||
apMentions?: MinimumUser[] | null; | ||
apHashtags?: string[] | null; | ||
apEmojis?: string[] | null; | ||
} | ||
|
||
@Entity('note_schedule') | ||
export class MiNoteSchedule { | ||
@PrimaryColumn(id()) | ||
public id: string; | ||
|
||
@Column('jsonb') | ||
public note: MiScheduleNoteType; | ||
|
||
@Index() | ||
@Column('varchar', { | ||
length: 260, | ||
}) | ||
public userId: MiUser['id']; | ||
|
||
@Column('timestamp with time zone') | ||
public scheduledAt: Date; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.