Addition of an AI chat assistant and a 100MB file upload limit.

This commit is contained in:
2026-09-30 16:30:41 +03:30
parent e94600a02e
commit ae21d9bbc7
8 changed files with 139 additions and 13 deletions
+4 -3
View File
@@ -12,7 +12,8 @@ export type ChatTextSeg = {
const URL_RE =
/https?:\/\/[^\s<>"'`]+|(?:www\.)[^\s<>"'`]+/gi;
const CRM_RE = /mento:\/\/(person|deal|ticket)\/([A-Za-z0-9_-]+)/gi;
/** لینک عمیق CRM — طرح فعلی montact؛ mento برای پیام‌های قدیمی پشتیبانی می‌شود */
const CRM_RE = /(?:montact|mento):\/\/(person|deal|ticket)\/([A-Za-z0-9_-]+)/gi;
const BOLD_RE = /\*([^*\n]+)\*/g;
const ITALIC_RE = /_([^_\n]+)_/g;
const LIST_LINE_RE = /^\s*[-•]\s+/;
@@ -145,7 +146,7 @@ function applyHighlight(parts: ChatTextSeg[], q: string): ChatTextSeg[] {
}
/**
* فرمت سبک شبیه تلگرام: *پررنگ*، _ایتالیک_، لیست با - ، لینک http، mento://…
* فرمت سبک شبیه تلگرام: *پررنگ*، _ایتالیک_، لیست با - ، لینک http، montact://…
*/
export function parseChatMessageText(
content: string,
@@ -191,6 +192,6 @@ export function insertCrmLink(
id: string,
title?: string,
): string {
const link = `mento://${kind}/${id}`;
const link = `montact://${kind}/${id}`;
return title ? `${title} ${link}` : link;
}
+2 -2
View File
@@ -136,7 +136,7 @@ function shouldCountUnread(roomId: string, content: string, fromSelf: boolean):
}
const IMAGE_MAX_EDGE = 1600;
const IMAGE_WEBP_QUALITY = 0.82;
const MAX_UPLOAD_BYTES = 40 * 1024 * 1024;
const MAX_UPLOAD_BYTES = 100 * 1024 * 1024;
/** Synced hard-delete marker (legacy edit attempts). */
const HARD_DELETE_MARKER = '__MENTO_DEL__';
/** Realtime hide command delivered as a normal text message (external WS delivers text reliably). */
@@ -1497,7 +1497,7 @@ export function useOrgChat() {
) {
if (!file) return;
if (file.size > MAX_UPLOAD_BYTES) {
throw new Error('حجم فایل بیش از حد مجاز است (۴۰ مگابایت)');
throw new Error('حجم فایل بیش از حد مجاز است (۱۰۰ مگابایت)');
}
const session = await ensureSession();