mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-29 05:17:39 -07:00
fix: 🐛 cannot quote own note
This commit is contained in:
parent
5e69fd791c
commit
4fa47bf677
1 changed files with 10 additions and 0 deletions
|
@ -146,6 +146,12 @@ export const meta = {
|
||||||
code: "CANNOT_CHANGE_VISIBILITY",
|
code: "CANNOT_CHANGE_VISIBILITY",
|
||||||
id: "2917fd0b-da04-41de-949f-146835a006c6",
|
id: "2917fd0b-da04-41de-949f-146835a006c6",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
cannotQuoteOwnNote: {
|
||||||
|
message: "You cannot quote your own note.",
|
||||||
|
code: "CANNOT_QUOTE_OWN_NOTE",
|
||||||
|
id: "070eee98-5f8a-4eca-9dc0-830b4d4e52ac",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
@ -274,6 +280,10 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||||
throw e;
|
throw e;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (ps.renoteId === note.id) {
|
||||||
|
throw new ApiError(meta.errors.cannotQuoteOwnNote);
|
||||||
|
}
|
||||||
|
|
||||||
if (renote.renoteId && !renote.text && !renote.fileIds && !renote.hasPoll) {
|
if (renote.renoteId && !renote.text && !renote.fileIds && !renote.hasPoll) {
|
||||||
throw new ApiError(meta.errors.cannotReRenote);
|
throw new ApiError(meta.errors.cannotReRenote);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue