feat: API服务支持ChatLab新版协议

This commit is contained in:
digua
2026-04-19 14:50:13 +08:00
parent 55885449a3
commit 0ba1067123
3 changed files with 265 additions and 61 deletions

View File

@@ -21,6 +21,8 @@ interface MessagePushPayload {
sourceName: string
groupName?: string
content: string | null
eventId: string
timestamp: number
}
const PUSH_CONFIG_KEYS = new Set([
@@ -313,6 +315,8 @@ class MessagePushService {
const sessionType = this.getSessionType(sessionId, session)
const content = this.getMessageDisplayContent(message)
const createTime = Number(message.createTime || 0)
if (isGroup) {
const groupInfo = await chatService.getContactAvatar(sessionId)
const groupName = session.displayName || groupInfo?.displayName || sessionId
@@ -326,7 +330,9 @@ class MessagePushService {
avatarUrl,
groupName,
sourceName,
content
content,
eventId: messageKey,
timestamp: createTime
}
}
@@ -339,7 +345,9 @@ class MessagePushService {
messageKey,
avatarUrl,
sourceName: session.displayName || contactInfo?.displayName || sessionId,
content
content,
eventId: messageKey,
timestamp: createTime
}
}