サロゲートペアを字数にカウントしないようにする (#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:
committed by
syuilo
parent
4dc8351f56
commit
b24f368d3f
@ -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() != '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user