Skip to content

Commit

Permalink
Revert "fix: スパムメッセージを弾いたときにinbox queueがリトライしようとするのを修正"
Browse files Browse the repository at this point in the history
This reverts commit b2b800d.
  • Loading branch information
hideki0403 committed Mar 1, 2024
1 parent 70d4182 commit afb5c02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/backend/src/core/NoteCreateService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export class NoteCreateService implements OnApplicationShutdown {
host: MiUser['host'];
isBot: MiUser['isBot'];
isCat: MiUser['isCat'];
}, data: Option, silent = false): Promise<MiNote | null> {
}, data: Option, silent = false): Promise<MiNote> {
// チャンネル外にリプライしたら対象のスコープに合わせる
// (クライアントサイドでやっても良い処理だと思うけどとりあえずサーバーサイドで)
if (data.reply && data.channel && data.reply.channelId !== data.channel.id) {
Expand Down Expand Up @@ -381,7 +381,7 @@ export class NoteCreateService implements OnApplicationShutdown {
const userEntity = await this.usersRepository.findOneBy({ id: user.id });
if ((userEntity?.followersCount ?? 0) === 0) {
this.logger.error('Request rejected because user has no local followers', { user: user.id, note: data });
return null;
throw new IdentifiableError('e11b3a16-f543-4885-8eb1-66cad131dbfd', 'Notes including mentions, replies, or renotes from remote users are not allowed until user has at least one local follower.');
}
}

Expand Down
10 changes: 0 additions & 10 deletions packages/backend/src/server/api/endpoints/notes/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,6 @@ export const meta = {
id: 'aa6e01d3-a85c-669d-758a-76aab43af334',
},

unknownError: {
message: 'Unknown error.',
code: 'UNKNOWN_ERROR',
id: 'ebb7b13d-1dd0-4f0b-b7c6-496230f0046b',
},

containsTooManyMentions: {
message: 'Cannot post because it exceeds the allowed number of mentions.',
code: 'CONTAINS_TOO_MANY_MENTIONS',
Expand Down Expand Up @@ -417,10 +411,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
deleteAt: ps.scheduledDelete?.deleteAt ? new Date(ps.scheduledDelete.deleteAt) : null,
});

if (note == null) {
throw new ApiError(meta.errors.unknownError);
}

return {
createdNote: await this.noteEntityService.pack(note, me),
};
Expand Down

0 comments on commit afb5c02

Please sign in to comment.