forked from yojo-art/cherrypick
-
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.
cherrypick from Type4ny-Project/Type4ny@e133a6b # Conflicts: # locales/index.d.ts # misskey-assets # packages/backend/src/core/NoteCreateService.ts # packages/backend/src/core/QueueModule.ts # packages/backend/src/core/QueueService.ts # packages/backend/src/di-symbols.ts # packages/backend/src/models/_.ts # packages/backend/src/queue/types.ts # packages/backend/src/server/api/endpoints/admin/queue/stats.ts # packages/backend/src/server/web/ClientServerService.ts # packages/frontend/src/components/MkPostForm.vue Co-authored-by: まっちゃてぃー。 <[email protected]>Signed-off-by: mattyatea <[email protected]>
- Loading branch information
1 parent
a7b8df8
commit 1892003
Showing
26 changed files
with
731 additions
and
7 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
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,29 @@ | ||
/* | ||
* SPDX-FileCopyrightText: syuilo and other misskey contributors | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
*/ | ||
|
||
import { Entity, Index, JoinColumn, Column, PrimaryColumn, ManyToOne } from 'typeorm'; | ||
import { noteVisibilities } from '@/types.js'; | ||
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'; | ||
|
||
@Entity('note_schedule') | ||
export class MiNoteSchedule { | ||
@PrimaryColumn(id()) | ||
public noteId: MiNote['id']; | ||
|
||
@Column('string') | ||
public note:{ apEmojis: any[] | undefined; visibility: any; apMentions: any[] | undefined; visibleUsers: MiUser[]; channel: null | MiChannel; poll: { multiple: any; choices: any; expiresAt: Date | null } | undefined; renote: null | MiNote; localOnly: any; cw: any; apHashtags: any[] | undefined; reactionAcceptance: any; files: MiDriveFile[]; text: any; reply: null | MiNote }; | ||
|
||
@Column('string') | ||
public user: MiUser & {host: null;uri: null;}; | ||
|
||
@Column('timestamp with time zone', { | ||
nullable: true, | ||
}) | ||
public expiresAt: 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
30 changes: 30 additions & 0 deletions
30
packages/backend/src/queue/processors/ScheduleNotePostProcessorService.ts
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,30 @@ | ||
/* | ||
* SPDX-FileCopyrightText: syuilo and other misskey contributors | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
*/ | ||
|
||
import { Inject, Injectable } from '@nestjs/common'; | ||
import type Logger from '@/logger.js'; | ||
import { bindThis } from '@/decorators.js'; | ||
import { NoteCreateService } from '@/core/NoteCreateService.js'; | ||
import { QueueLoggerService } from '../QueueLoggerService.js'; | ||
import type * as Bull from 'bullmq'; | ||
import type { ScheduleNotePostJobData } from '../types.js'; | ||
|
||
@Injectable() | ||
export class ScheduleNotePostProcessorService { | ||
private logger: Logger; | ||
|
||
constructor( | ||
private noteCreateService: NoteCreateService, | ||
private queueLoggerService: QueueLoggerService, | ||
) { | ||
this.logger = this.queueLoggerService.logger.createSubLogger('ended-poll-notification'); | ||
} | ||
|
||
@bindThis | ||
public async process(job: Bull.Job<ScheduleNotePostJobData>): Promise<void> { | ||
job.data.note.createdAt = new Date(); | ||
await this.noteCreateService.create(job.data.user, job.data.note); | ||
} | ||
} |
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.