diff --git a/config.template.yaml b/config.template.yaml index 03c307fa..3652ddd4 100644 --- a/config.template.yaml +++ b/config.template.yaml @@ -128,7 +128,7 @@ max-channels-per-user: 5 max-accounts-per-ip: 5 # Minimum number of seconds between guest logins from the same IP guest-login-delay: 60 -# Maximum character length of a chat message +# Maximum character length of a chat message, capped at 1000 characters max-chat-message-length: 320 # Allows you to customize the path divider. The /r/ in http://localhost/r/yourchannel diff --git a/src/config.js b/src/config.js index 1fe888d0..dd6b32aa 100644 --- a/src/config.js +++ b/src/config.js @@ -428,6 +428,11 @@ function preprocessConfig(cfg) { cfg['channel-storage'] = { type: undefined }; } + if (cfg["max-chat-message-length"] > 1000) { + LOGGER.warn("Max chat message length was greater than 1000. Setting to 1000."); + cfg["max-chat-message-length"] = 1000; + } + return cfg; }