sendMsg之后,接收deliveredMsg的回调函数绑定到tempMsgId

This commit is contained in:
bob
2024-10-09 21:17:41 +08:00
parent 1292123449
commit d3ee35cfd1
3 changed files with 24 additions and 14 deletions

View File

@@ -3,7 +3,7 @@ import { proto } from '@/const/msgConst'
import { userStore } from '@/stores'
import { v4 as uuidv4 } from 'uuid'
export const chatConstructor = (toId, content) => {
export const chatConstructor = (toId, content, tempMsgId) => {
const header = Header.create({
magic: proto.magic,
version: proto.version,
@@ -17,7 +17,7 @@ export const chatConstructor = (toId, content) => {
fromClient: userData.clientId,
toId: toId,
content: content,
tempMsgId: uuidv4()
tempMsgId: tempMsgId
})
const chatMsg = Msg.create({ header: header, body: body })
const payload = Msg.encode(chatMsg).finish()