Skip to content

Commit b6a6379

Browse files
committed
予約投稿の未使用オプション削除
1 parent 8409fd0 commit b6a6379

File tree

2 files changed

+0
-28
lines changed
  • packages
    • backend/src/server/api/endpoints/notes/schedule
    • cherrypick-js/src/autogen

2 files changed

+0
-28
lines changed

packages/backend/src/server/api/endpoints/notes/schedule/create.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import type {
1515
DriveFilesRepository,
1616
ChannelsRepository,
1717
NoteScheduleRepository,
18-
MiNoteSchedule,
1918
} from '@/models/_.js';
2019
import type { MiDriveFile } from '@/models/DriveFile.js';
2120
import type { MiNote } from '@/models/Note.js';
@@ -25,7 +24,6 @@ import { Endpoint } from '@/server/api/endpoint-base.js';
2524
import { DI } from '@/di-symbols.js';
2625
import { QueueService } from '@/core/QueueService.js';
2726
import { IdService } from '@/core/IdService.js';
28-
import { IEvent } from '@/models/Event.js';
2927
import { MiScheduleNoteType } from '@/models/NoteSchedule.js';
3028
import { RoleService } from '@/core/RoleService.js';
3129
import { ApiError } from '../../../error.js';
@@ -137,7 +135,6 @@ export const paramDef = {
137135
noExtractEmojis: { type: 'boolean', default: false },
138136
replyId: { type: 'string', format: 'misskey:id', nullable: true },
139137
renoteId: { type: 'string', format: 'misskey:id', nullable: true },
140-
channelId: { type: 'string', format: 'misskey:id', nullable: true },
141138

142139
// anyOf内にバリデーションを書いても最初の一つしかチェックされない
143140
// See https://github.com/misskey-dev/misskey/pull/10082
@@ -295,19 +292,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
295292
// specified / direct noteはreject
296293
throw new ApiError(meta.errors.cannotRenoteDueToVisibility);
297294
}
298-
299-
if (renote.channelId && renote.channelId !== ps.channelId) {
300-
// チャンネルのノートに対しリノート要求がきたとき、チャンネル外へのリノート可否をチェック
301-
// リノートのユースケースのうち、チャンネル内→チャンネル外は少数だと考えられるため、JOINはせず必要な時に都度取得する
302-
const renoteChannel = await this.channelsRepository.findOneById(renote.channelId);
303-
if (renoteChannel == null) {
304-
// リノートしたいノートが書き込まれているチャンネルが無い
305-
throw new ApiError(meta.errors.noSuchChannel);
306-
} else if (!renoteChannel.allowRenoteToExternal) {
307-
// リノート作成のリクエストだが、対象チャンネルがリノート禁止だった場合
308-
throw new ApiError(meta.errors.cannotRenoteOutsideOfChannel);
309-
}
310-
}
311295
}
312296

313297
let reply: MiNote | null = null;
@@ -348,15 +332,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
348332
ps.poll.expiresAt = schedule_expiresAt + ps.poll.expiredAfter;
349333
}
350334
}
351-
352-
let channel: MiChannel | null = null;
353-
if (ps.channelId != null) {
354-
channel = await this.channelsRepository.findOneBy({ id: ps.channelId, isArchived: false });
355-
356-
if (channel == null) {
357-
throw new ApiError(meta.errors.noSuchChannel);
358-
}
359-
}
360335
if (typeof ps.schedule.expiresAt === 'number') {
361336
if (ps.schedule.expiresAt < Date.now()) {
362337
throw new ApiError(meta.errors.cannotCreateAlreadyExpiredSchedule);
@@ -380,7 +355,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
380355
reactionAcceptance: ps.reactionAcceptance,
381356
visibility: ps.visibility,
382357
visibleUsers,
383-
channel: channel?.id,
384358
apMentions: ps.noExtractMentions ? [] : undefined,
385359
apHashtags: ps.noExtractHashtags ? [] : undefined,
386360
apEmojis: ps.noExtractEmojis ? [] : undefined,

packages/cherrypick-js/src/autogen/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22153,8 +22153,6 @@ export type operations = {
2215322153
replyId?: string | null;
2215422154
/** Format: misskey:id */
2215522155
renoteId?: string | null;
22156-
/** Format: misskey:id */
22157-
channelId?: string | null;
2215822156
text?: string | null;
2215922157
fileIds?: string[];
2216022158
mediaIds?: string[];

0 commit comments

Comments
 (0)