diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2018-10-24 04:00:04 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2018-10-24 04:00:04 +0900 |
| commit | daa22d68fa8a55a2e65a1de541f903edb64ff042 (patch) | |
| tree | 6307e3b1ff7a411b96a4213ed4685f9c32b6c3a6 /src/models/note.ts | |
| parent | 10.30.3 (diff) | |
| download | sharkey-daa22d68fa8a55a2e65a1de541f903edb64ff042.tar.gz sharkey-daa22d68fa8a55a2e65a1de541f903edb64ff042.tar.bz2 sharkey-daa22d68fa8a55a2e65a1de541f903edb64ff042.zip | |
Make max allowed text length configurable (#2992)
* Make max allowed text length configurable
* Fix canPost
Diffstat (limited to 'src/models/note.ts')
| -rw-r--r-- | src/models/note.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/models/note.ts b/src/models/note.ts index aeec075636..6edf6ec317 100644 --- a/src/models/note.ts +++ b/src/models/note.ts @@ -14,6 +14,7 @@ import NoteReaction from './note-reaction'; import Favorite, { deleteFavorite } from './favorite'; import Notification, { deleteNotification } from './notification'; import Following from './following'; +import config from '../config'; const Note = db.get<INote>('notes'); Note.createIndex('uri', { sparse: true, unique: true }); @@ -29,7 +30,7 @@ Note.createIndex({ export default Note; export function isValidText(text: string): boolean { - return length(text.trim()) <= 1000 && text.trim() != ''; + return length(text.trim()) <= config.maxNoteTextLength && text.trim() != ''; } export function isValidCw(text: string): boolean { |