summaryrefslogtreecommitdiff
path: root/src/models
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-11-05 11:09:05 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-11-05 11:09:05 +0900
commitd7a3b710281f19746aaccaf23c07feb700503f39 (patch)
tree102229af5c4906d5071603f5e3311e04c2559e9c /src/models
parentRemove Travis (diff)
downloadsharkey-d7a3b710281f19746aaccaf23c07feb700503f39.tar.gz
sharkey-d7a3b710281f19746aaccaf23c07feb700503f39.tar.bz2
sharkey-d7a3b710281f19746aaccaf23c07feb700503f39.zip
投稿の最大文字数情報を設定ファイルではなくDBに保存するように
Diffstat (limited to 'src/models')
-rw-r--r--src/models/meta.ts5
-rw-r--r--src/models/note.ts5
2 files changed, 5 insertions, 5 deletions
diff --git a/src/models/meta.ts b/src/models/meta.ts
index 6d75258df8..d8a9b46037 100644
--- a/src/models/meta.ts
+++ b/src/models/meta.ts
@@ -43,4 +43,9 @@ export type IMeta = {
disableLocalTimeline?: boolean;
hidedTags?: string[];
bannerUrl?: string;
+
+ /**
+ * Max allowed note text length in charactors
+ */
+ maxNoteTextLength?: number;
};
diff --git a/src/models/note.ts b/src/models/note.ts
index 6856d6d07d..516045225c 100644
--- a/src/models/note.ts
+++ b/src/models/note.ts
@@ -11,7 +11,6 @@ import Reaction from './note-reaction';
import { packMany as packFileMany, IDriveFile } from './drive-file';
import Favorite from './favorite';
import Following from './following';
-import config from '../config';
import Emoji from './emoji';
const Note = db.get<INote>('notes');
@@ -27,10 +26,6 @@ Note.createIndex({ createdAt: -1 });
Note.createIndex({ score: -1 }, { sparse: true });
export default Note;
-export function isValidText(text: string): boolean {
- return length(text.trim()) <= config.maxNoteTextLength && text.trim() != '';
-}
-
export function isValidCw(text: string): boolean {
return length(text.trim()) <= 100;
}