Add mentions, pin messages and conversations, and search within chats

This commit is contained in:
2026-09-30 10:40:29 +03:30
parent 7c4b24fad6
commit f71e78f3a7
9 changed files with 1152 additions and 31 deletions
+31
View File
@@ -210,6 +210,8 @@ model Organization {
conversationSettings ConversationSettings?
conversationRooms ConversationRoom[]
conversationHiddenMessages ConversationHiddenMessage[]
conversationPinnedMessages ConversationPinnedMessage[]
conversationRoomUserPins ConversationRoomUserPin[]
}
model User {
@@ -2113,3 +2115,32 @@ model ConversationHiddenMessage {
@@unique([organizationId, externalRoomId, messageId, scope, hiddenByUserId])
@@index([organizationId, externalRoomId])
}
/// یک پیام سنجاق‌شده در هر اتاق (برای همه اعضا)
model ConversationPinnedMessage {
id String @id @default(cuid())
organizationId String
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
externalRoomId String
messageId String
preview String @default("")
pinnedByUserId String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([organizationId, externalRoomId])
@@index([organizationId, externalRoomId])
}
/// سنجاق گفتگو در لیست — فقط برای همان کاربر
model ConversationRoomUserPin {
id String @id @default(cuid())
organizationId String
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
userId String
externalRoomId String
createdAt DateTime @default(now())
@@unique([organizationId, userId, externalRoomId])
@@index([organizationId, userId])
}