View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/647 Closes #686 and #696 Approved-by: Marie <github@yuugi.dev> Approved-by: dakkar <dakkar@thenautilus.net>
This commit is contained in:
@@ -252,7 +252,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||
private noteCreateService: NoteCreateService,
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
if (ps.text && (ps.text.length > this.config.maxNoteLength)) {
|
||||
const contentLength = (ps.text?.length ?? 0) + (ps.cw?.length ?? 0);
|
||||
if (contentLength > this.config.maxNoteLength) {
|
||||
throw new ApiError(meta.errors.maxLength);
|
||||
}
|
||||
|
||||
|
||||
@@ -297,9 +297,11 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||
private noteEditService: NoteEditService,
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
if (ps.text && (ps.text.length > this.config.maxNoteLength)) {
|
||||
const contentLength = (ps.text?.length ?? 0) + (ps.cw?.length ?? 0);
|
||||
if (contentLength > this.config.maxNoteLength) {
|
||||
throw new ApiError(meta.errors.maxLength);
|
||||
}
|
||||
|
||||
let visibleUsers: MiUser[] = [];
|
||||
if (ps.visibleUserIds) {
|
||||
visibleUsers = await this.usersRepository.findBy({
|
||||
|
||||
Reference in New Issue
Block a user