Merge branch 'develop' into merge/2024-02-03

# Conflicts:
#	locales/index.d.ts
#	packages/backend/src/core/entities/UserEntityService.ts
#	packages/frontend/src/_dev_boot_.ts
#	packages/misskey-js/src/autogen/types.ts
#	sharkey-locales/en-US.yml
This commit is contained in:
Hazelnoot 2025-02-07 11:54:29 -05:00
commit f36029f795
24 changed files with 512 additions and 35 deletions

View file

@ -133,6 +133,12 @@ export const meta = {
id: '0b3f9f6a-2f4d-4b1f-9fb4-49d3a2fd7191',
httpStatusCode: 422,
},
maxCwLength: {
message: 'You tried setting a default content warning which is too long.',
code: 'MAX_CW_LENGTH',
id: '7004c478-bda3-4b4f-acb2-4316398c9d52',
},
},
res: {
@ -243,6 +249,12 @@ export const paramDef = {
uniqueItems: true,
items: { type: 'string' },
},
defaultCW: { type: 'string', nullable: true },
defaultCWPriority: {
type: 'string',
enum: ['default', 'parent', 'defaultParent', 'parentDefault'],
nullable: false,
},
},
} as const;
@ -494,6 +506,19 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
updates.alsoKnownAs = newAlsoKnownAs.size > 0 ? Array.from(newAlsoKnownAs) : null;
}
let defaultCW = ps.defaultCW;
if (defaultCW !== undefined) {
if (defaultCW === '') defaultCW = null;
if (defaultCW && defaultCW.length > this.config.maxCwLength) {
throw new ApiError(meta.errors.maxCwLength);
}
profileUpdates.defaultCW = defaultCW;
}
if (ps.defaultCWPriority !== undefined) {
profileUpdates.defaultCWPriority = ps.defaultCWPriority;
}
//#region emojis/tags
let emojis = [] as string[];