合并 main:同步聊天、风控诊断与迁移基线
This commit is contained in:
commit
a6c0d36ee9
89 files changed
+2974
-365
No files matched your search
@@ -1,4 +1,19 @@
|
||||
import type { ChatMessage, ChatSession } from '../../../shared/api-contract';
|
||||
import type { ChatReadReceipt } from './types';
|
||||
|
||||
/** 将可确认的普通入站消息转换为平台已读回执。 */
|
||||
export const collectChatReadReceipts = (messages: ChatMessage[], chatID: string): ChatReadReceipt[] => messages
|
||||
.filter(/* currentMessage 只保留平台可接受的普通入站消息。 */ currentMessage => (
|
||||
currentMessage.direction === 'incoming'
|
||||
&& currentMessage.message_type !== 'system'
|
||||
&& !currentMessage.message_key.startsWith('in-')
|
||||
))
|
||||
.map(/* currentMessage 为每条消息构造其所属会话的已读确认。 */ currentMessage => ({
|
||||
messageId: currentMessage.message_key,
|
||||
sessionId: chatID,
|
||||
cid: `${chatID}@goofish`,
|
||||
conversationType: 1,
|
||||
}));
|
||||
|
||||
/** 按搜索条件筛选会话列表。 */
|
||||
export const filterChatSessions = (sessions: ChatSession[], search: string, unreadOnly: boolean): ChatSession[] => {
|
||||
|
||||
Reference in new issue
Block a user