Fix username links resulting in truncated chat messages (#11945)

* introduce MAX_MESSAGE_LENGTH constant

* add test

* fix path

* fix and tests

* fix typo in tests
This commit is contained in:
Matteo Pagliazzi
2020-03-04 11:49:14 +01:00
committed by GitHub
parent 75068ceb9e
commit 2ff9dfe965
9 changed files with 54 additions and 13 deletions
+1
View File
@@ -9,6 +9,7 @@ export const LARGE_GROUP_COUNT_MESSAGE_CUTOFF = 5000;
export const MAX_SUMMARY_SIZE_FOR_GUILDS = 250;
export const MAX_SUMMARY_SIZE_FOR_CHALLENGES = 250;
export const MIN_SHORTNAME_SIZE_FOR_CHALLENGES = 3;
export const MAX_MESSAGE_LENGTH = 3000;
export const CHAT_FLAG_LIMIT_FOR_HIDING = 2; // hide posts that have this many flags
export const CHAT_FLAG_FROM_MOD = 5; // a flag from a moderator counts as this many flags
+2
View File
@@ -18,6 +18,7 @@ import {
MINIMUM_PASSWORD_LENGTH,
SUPPORTED_SOCIAL_NETWORKS,
TAVERN_ID,
MAX_MESSAGE_LENGTH,
} from './constants';
import content from './content/index';
import * as count from './count';
@@ -108,6 +109,7 @@ api.constants = {
CHAT_FLAG_FROM_MOD,
CHAT_FLAG_FROM_SHADOW_MUTE,
MINIMUM_PASSWORD_LENGTH,
MAX_MESSAGE_LENGTH,
};
// TODO Move these under api.constants
api.maxLevel = MAX_LEVEL;