feat: add content.maxLength setting

Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>
This commit is contained in:
Ricardo Arturo Cabral Mejía 2022-11-20 10:23:18 -05:00
parent 9928a0e4dc
commit 2089c9fd61
3 changed files with 11 additions and 0 deletions

View File

@ -43,11 +43,16 @@ export interface CreatedAtLimits {
maxPositiveDelta?: number
}
export interface ContentLimits {
maxLength?: number
}
export interface EventLimits {
eventId?: EventIdLimits
pubkey?: PubkeyLimits
kind?: KindLimits
createdAt?: CreatedAtLimits
content?: ContentLimits
rateLimits?: EventRateLimit[]
}

View File

@ -50,6 +50,9 @@ export class SettingsStatic {
maxPositiveDelta: 900,
maxNegativeDelta: 0, // disabled
},
content: {
maxLength: 1048576,
},
rateLimits: [
{
kinds: [

View File

@ -72,6 +72,9 @@ describe('SettingsStatic', () => {
maxPositiveDelta: 900, // +15 min
maxNegativeDelta: 0, // disabled
},
content: {
maxLength: 1048576,
},
'rateLimits': [
{
'kinds': [[0, 5], 7, [40, 49], [10000, 19999], [30000, 39999]],