Apply DB limit to the maximum note text length (#5465)
This commit is contained in:
parent
cea2d621f2
commit
6ba5968861
4 changed files with 16 additions and 3 deletions
|
|
@ -7,6 +7,7 @@ import * as pkg from '../../../../package.json';
|
|||
import { Emojis } from '../../../models';
|
||||
import { getConnection } from 'typeorm';
|
||||
import redis from '../../../db/redis';
|
||||
import { DB_MAX_NOTE_TEXT_LENGTH } from '../../../misc/hard-limits';
|
||||
|
||||
export const meta = {
|
||||
stability: 'stable',
|
||||
|
|
@ -138,7 +139,7 @@ export default define(meta, async (ps, me) => {
|
|||
bannerUrl: instance.bannerUrl,
|
||||
errorImageUrl: instance.errorImageUrl,
|
||||
iconUrl: instance.iconUrl,
|
||||
maxNoteTextLength: instance.maxNoteTextLength,
|
||||
maxNoteTextLength: Math.min(instance.maxNoteTextLength, DB_MAX_NOTE_TEXT_LENGTH),
|
||||
emojis: emojis.map(e => ({
|
||||
id: e.id,
|
||||
aliases: e.aliases,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue