add "reject quotes" toggle at user and instance level

+ improve, cleanup, and de-duplicate quote resolution
+ add warning message when quote cannot be loaded
+ add "process error" framework to display warnings when a note cannot be correctly loaded from another instance
This commit is contained in:
Hazelnoot 2025-02-15 23:08:02 -05:00
parent 93ffd4611c
commit 292d3b9229
36 changed files with 466 additions and 88 deletions

View file

@ -143,6 +143,12 @@ export const meta = {
code: 'CONTAINS_TOO_MANY_MENTIONS',
id: '4de0363a-3046-481b-9b0f-feff3e211025',
},
quoteDisabledForUser: {
message: 'You do not have permission to create quote posts.',
code: 'QUOTE_DISABLED_FOR_USER',
id: '1c0ea108-d1e3-4e8e-aa3f-4d2487626153',
},
},
} as const;
@ -415,6 +421,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw new ApiError(meta.errors.containsProhibitedWords);
} else if (e.id === '9f466dab-c856-48cd-9e65-ff90ff750580') {
throw new ApiError(meta.errors.containsTooManyMentions);
} else if (e.id === '1c0ea108-d1e3-4e8e-aa3f-4d2487626153') {
throw new ApiError(meta.errors.quoteDisabledForUser);
}
}
throw e;