サロゲートペアを字数にカウントしないようにする (#2661)

* Update post-form.vue

* Update messaging-message.ts

* Update post-form.vue

* Update note.ts

* Update post-form.vue

refs: https://github.com/syuilo/misskey/pull/2661#issuecomment-419579444

* Update post-form.vue

refs: https://github.com/syuilo/misskey/pull/2661#issuecomment-419579444

* Update messaging-message.ts

refs: https://github.com/syuilo/misskey/pull/2661#issuecomment-419579444

* Update note.ts

refs: https://github.com/syuilo/misskey/pull/2661#issuecomment-419579444

* Update post-form.vue

refs: https://github.com/syuilo/misskey/pull/2661#discussion_r216175581

* Update post-form.vue

* Update post-form.vue

refs: https://github.com/syuilo/misskey/pull/2661#discussion_r216242002

* Update post-form.vue

refs: https://github.com/syuilo/misskey/pull/2661#discussion_r216242105
This commit is contained in:
Acid Chicken (硫酸鶏)
2018-09-10 18:02:46 +09:00
committed by syuilo
parent 4dc8351f56
commit b24f368d3f
4 changed files with 18 additions and 6 deletions

View File

@ -4,6 +4,7 @@ import { pack as packUser } from './user';
import { pack as packFile } from './drive-file';
import db from '../db/mongodb';
import MessagingHistory, { deleteMessagingHistory } from './messaging-history';
import { length } from 'stringz';
const MessagingMessage = db.get<IMessagingMessage>('messagingMessages');
export default MessagingMessage;
@ -19,7 +20,7 @@ export interface IMessagingMessage {
}
export function isValidText(text: string): boolean {
return text.length <= 1000 && text.trim() != '';
return length(text.trim()) <= 1000 && text.trim() != '';
}
/**