Skip to content

Commit

Permalink
fix (backend): Prevent Renote only with CW or reoly
Browse files Browse the repository at this point in the history
  • Loading branch information
atsu1125 committed Apr 21, 2024
1 parent 64a36ca commit 53044ec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/server/api/endpoints/notes/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ export default define(meta, async (ps, user) => {
throw new ApiError(meta.errors.contentRequired);
}

if (renote && !(ps.text || files.length || ps.poll) && (ps.cw || reply)) {
throw new ApiError(meta.errors.contentRequired);
}

let channel: Channel | undefined;
if (ps.channelId != null) {
channel = await Channels.findOne(ps.channelId);
Expand Down

0 comments on commit 53044ec

Please sign in to comment.