@aochuang/client-sdk 1.0.352 → 1.0.353
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -74,7 +74,7 @@ export default class ClientChatMessage {
|
|
|
74
74
|
* "createTime": 1723710023517,
|
|
75
75
|
* "id": "6612b84538679a8c881e9f8482ccda9e9b35c00d",
|
|
76
76
|
* "isDeleted": false,
|
|
77
|
-
* "
|
|
77
|
+
* "isSend": false,
|
|
78
78
|
* "msgId": "1245",
|
|
79
79
|
* "msgSubType": 0,
|
|
80
80
|
* "msgSvrId": "4319123759514541049",
|
|
@@ -115,7 +115,7 @@ export default class ClientChatMessage {
|
|
|
115
115
|
}
|
|
116
116
|
this.data.messageData[groupField][sortFields.day][sortFields.milliseconds].push(data)
|
|
117
117
|
this.messageMap[data.id] = data
|
|
118
|
-
if (data.
|
|
118
|
+
if (data.isSend && data.status === 1 && !data._temp) this.addCheckMessageSendResultTask(data)
|
|
119
119
|
if (fireEvent !== false) {
|
|
120
120
|
this.event && this.event.emit('add-message', {
|
|
121
121
|
data
|
|
@@ -107,7 +107,7 @@ class ClientChat {
|
|
|
107
107
|
this._sessionPollRequestMap[sessionId].start().then((rs) => {
|
|
108
108
|
// 后端更新会话是异步过程,返回的会话信息可能还未包含当前消息
|
|
109
109
|
if (rs && rs.data && !rs.data.unreadMsgCount) {
|
|
110
|
-
rs.data.unreadMsgCount = data.
|
|
110
|
+
rs.data.unreadMsgCount = data.isSend ? 0 : 1
|
|
111
111
|
rs.data.lastMsgContent = data.content
|
|
112
112
|
rs.data.lastMsgType = data.msgType
|
|
113
113
|
rs.data.lastMsgTime = data.sendTime
|
|
@@ -124,7 +124,7 @@ class ClientChat {
|
|
|
124
124
|
} else {
|
|
125
125
|
this.session.updateSession(sessionId, ({ session }) => {
|
|
126
126
|
let unreadMsgCount = session.unreadMsgCount
|
|
127
|
-
if (!data.
|
|
127
|
+
if (!data.isSend) {
|
|
128
128
|
unreadMsgCount = unreadMsgCount + 1
|
|
129
129
|
}
|
|
130
130
|
// 如果是当前会话,那么未读消息需要设置为0
|
|
@@ -188,7 +188,7 @@ class ClientChat {
|
|
|
188
188
|
this._sessionPollRequestMap[sessionId].start().then((rs) => {
|
|
189
189
|
// 后端更新会话是异步过程,返回的会话信息可能还未包含当前消息
|
|
190
190
|
if (rs && rs.data && !rs.data.unreadMsgCount) {
|
|
191
|
-
rs.data.unreadMsgCount = data.
|
|
191
|
+
rs.data.unreadMsgCount = data.isSend ? 0 : 1
|
|
192
192
|
rs.data.lastMsgContent = data.content
|
|
193
193
|
rs.data.lastMsgType = data.msgType
|
|
194
194
|
rs.data.lastMsgTime = data.sendTime
|
|
@@ -205,7 +205,7 @@ class ClientChat {
|
|
|
205
205
|
} else {
|
|
206
206
|
this.session.updateSession(sessionId, ({ session }) => {
|
|
207
207
|
let unreadMsgCount = session.unreadMsgCount
|
|
208
|
-
if (!data.
|
|
208
|
+
if (!data.isSend) {
|
|
209
209
|
unreadMsgCount = unreadMsgCount + 1
|
|
210
210
|
}
|
|
211
211
|
// 如果是当前会话,那么未读消息需要设置为0
|