@aochuang/client-sdk 1.0.379-wework-3 → 1.0.379-wework-4
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/components/wework-chat-panel/chat-panel-chat-status/chat-panel-chat-status.vue +47 -10
- package/components/wework-chat-panel/chat-panel-item.vue +30 -24
- package/package.json +1 -1
- package/services/client-chat/client-chat-wework/client-chat-message.js +147 -0
- package/services/client-chat/client-chat-wework/client-chat-socket.js +2 -15
- package/services/client-chat/client-chat-wework/client-chat.js +18 -11
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="sdk-wework-panel-chat-status">
|
|
3
3
|
<!-- status: 0 success, 1 sending, 2 failed, 3 timeout -->
|
|
4
|
-
<template v-if="data.
|
|
4
|
+
<template v-if="data.recalling">
|
|
5
|
+
<span class="sdk-wework-panel-chat-status__recalling">
|
|
6
|
+
<ui-loading size="mini"></ui-loading>
|
|
7
|
+
撤回中...
|
|
8
|
+
</span>
|
|
9
|
+
</template>
|
|
10
|
+
<template v-else-if="data.recallStatus === 'failed'">
|
|
11
|
+
<bi-tooltip :text="`撤回失败:${data.recallResultMsg || '未知原因'}`">
|
|
12
|
+
<span class="sdk-wework-panel-chat-status__recall-result sdk-wework-panel-chat-status__recall-result--failed">
|
|
13
|
+
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M512 938.666667C276.352 938.666667 85.333333 747.648 85.333333 512S276.352 85.333333 512 85.333333s426.666667 191.018667 426.666667 426.666667-191.018667 426.666667-426.666667 426.666667z m0-486.997334L391.338667 330.965333 330.965333 391.338667 451.669333 512l-120.704 120.661333 60.373334 60.373334L512 572.330667l120.661333 120.704 60.373334-60.373334L572.330667 512l120.704-120.661333-60.373334-60.373334L512 451.669333z" fill="currentColor"></path></svg>
|
|
14
|
+
撤回失败
|
|
15
|
+
</span>
|
|
16
|
+
</bi-tooltip>
|
|
17
|
+
</template>
|
|
18
|
+
<template v-else-if="data.recallStatus === 'timeout'">
|
|
19
|
+
<bi-tooltip :text="data.recallResultMsg || '获取结果超时'">
|
|
20
|
+
<span class="sdk-wework-panel-chat-status__recall-result sdk-wework-panel-chat-status__recall-result--timeout">
|
|
21
|
+
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M512 938.666667C276.352 938.666667 85.333333 747.648 85.333333 512S276.352 85.333333 512 85.333333s426.666667 191.018667 426.666667 426.666667-191.018667 426.666667-426.666667 426.666667z m42.666667-426.666667V298.666667h-85.333334v298.666666h256v-85.333333h-170.666666z" fill="currentColor"></path></svg>
|
|
22
|
+
获取结果超时
|
|
23
|
+
</span>
|
|
24
|
+
</bi-tooltip>
|
|
25
|
+
</template>
|
|
26
|
+
<template v-else-if="data.status === 1">
|
|
5
27
|
<ui-loading size="mini"></ui-loading>
|
|
6
28
|
</template>
|
|
7
29
|
<template v-else-if="data.status === 2">
|
|
@@ -18,13 +40,6 @@
|
|
|
18
40
|
</span>
|
|
19
41
|
</bi-tooltip>
|
|
20
42
|
</template>
|
|
21
|
-
<template v-if="data.recalled">
|
|
22
|
-
<bi-tooltip text="消息已撤回">
|
|
23
|
-
<span class="sdk-wework-panel-chat-status__error sdk-wework-panel-chat-status__recalled">
|
|
24
|
-
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M512 0c282.752 0 512 229.248 512 512s-229.248 512-512 512S0 794.752 0 512 229.248 0 512 0z m-50.261333 255.317333c-7.765333-39.338667-39.893333-15.36-39.893334-15.36l-213.76 192c-47.616 34.944-2.730667 60.458667-2.730666 60.458667l211.541333 190.933333c42.410667 33.066667 45.866667-17.749333 45.866667-17.749333v-86.442667c215.125333-70.144 303.36 208.341333 303.36 208.341334 7.936 15.957333 13.824 0 13.824 0C862.933333 368.682667 461.952 348.586667 461.952 348.586667z" fill="currentColor"></path></svg>
|
|
25
|
-
</span>
|
|
26
|
-
</bi-tooltip>
|
|
27
|
-
</template>
|
|
28
43
|
</div>
|
|
29
44
|
</template>
|
|
30
45
|
|
|
@@ -64,8 +79,30 @@ export default {
|
|
|
64
79
|
height: 100%;
|
|
65
80
|
}
|
|
66
81
|
}
|
|
67
|
-
.sdk-wework-panel-chat-
|
|
68
|
-
|
|
82
|
+
.sdk-wework-panel-chat-status__recalling {
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
gap: 4px;
|
|
86
|
+
color: #999;
|
|
87
|
+
font-size: 12px;
|
|
88
|
+
white-space: nowrap;
|
|
89
|
+
}
|
|
90
|
+
.sdk-wework-panel-chat-status__recall-result {
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
gap: 4px;
|
|
94
|
+
font-size: 12px;
|
|
95
|
+
white-space: nowrap;
|
|
96
|
+
.icon {
|
|
97
|
+
width: 14px;
|
|
98
|
+
height: 14px;
|
|
99
|
+
}
|
|
100
|
+
&--failed {
|
|
101
|
+
color: #c00;
|
|
102
|
+
}
|
|
103
|
+
&--timeout {
|
|
104
|
+
color: #d48806;
|
|
105
|
+
}
|
|
69
106
|
}
|
|
70
107
|
.sdk-wework-panel-chat-status {
|
|
71
108
|
margin: 0 6px;
|
|
@@ -4,31 +4,37 @@
|
|
|
4
4
|
>
|
|
5
5
|
<template slot-scope="{ configData }">
|
|
6
6
|
<div class="sdk-wechat-panel-item" :data-id="item.id">
|
|
7
|
-
<template v-if="item.msgType !== '_EMPTY_'">
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
<template v-if="item.msgType !== '_EMPTY_' && !item.recalled">
|
|
8
|
+
<slot name="chat-prefix" :item="item"></slot>
|
|
9
|
+
</template>
|
|
10
|
+
<template v-if="item.recalled">
|
|
11
|
+
<sdk-chat-control-jx-sys-text
|
|
12
|
+
:id="item.id"
|
|
13
|
+
content="撤回了一条消息"
|
|
14
|
+
></sdk-chat-control-jx-sys-text>
|
|
15
|
+
</template>
|
|
16
|
+
<template v-else-if="item.msgType === MESSAGE_TYPE.TEXT || item.msgType === MESSAGE_TYPE.TEXT_W">
|
|
17
|
+
<sdk-chat-panel-box
|
|
18
|
+
:dir="dir"
|
|
19
|
+
:data="item"
|
|
20
|
+
:fetchUserMethod="fetchUserMethod"
|
|
21
|
+
max-width="540px"
|
|
22
|
+
@user-avatar-click="handleUserAvatarClick"
|
|
23
|
+
@user-avatar-contextmenu="handleUserAvatarContextmenu"
|
|
18
24
|
>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
<template slot-scope="{ setFootVnode }">
|
|
26
|
+
<sdk-chat-control-text
|
|
27
|
+
v-bind="configData"
|
|
28
|
+
:id="item.id"
|
|
29
|
+
:content="msgContent"
|
|
30
|
+
:set-chat-box-foot-vnode="setFootVnode"
|
|
31
|
+
></sdk-chat-control-text>
|
|
32
|
+
</template>
|
|
33
|
+
<template slot="append" slot-scope="{ updateProp }">
|
|
34
|
+
<slot name="chat-append" :item="item" :update-chat-box-prop="updateProp"></slot>
|
|
35
|
+
</template>
|
|
36
|
+
</sdk-chat-panel-box>
|
|
37
|
+
</template>
|
|
32
38
|
<template v-else-if="item.msgType === MESSAGE_TYPE.IMAGE">
|
|
33
39
|
<sdk-chat-panel-box
|
|
34
40
|
:dir="dir"
|
package/package.json
CHANGED
|
@@ -26,6 +26,7 @@ export default class ClientChatMessage {
|
|
|
26
26
|
lastMessageTimeMap = {}
|
|
27
27
|
tempMessageMap = {}
|
|
28
28
|
checkMessageSendResultTaskList = []
|
|
29
|
+
recallTaskMap = {}
|
|
29
30
|
|
|
30
31
|
get messageData () {
|
|
31
32
|
return this.data.messageData
|
|
@@ -38,6 +39,8 @@ export default class ClientChatMessage {
|
|
|
38
39
|
sortField: null, // 排序的字段,必须是唯一的,例如时间
|
|
39
40
|
groupField: null, // 分组的字段
|
|
40
41
|
checkMessageSendResultMethod: null,
|
|
42
|
+
recallMessageMethod: null,
|
|
43
|
+
recallMessageIdField: null,
|
|
41
44
|
onAddMessageSuccess: null // 新增消息成功回调事件
|
|
42
45
|
}, options)
|
|
43
46
|
if (!options.clientChat) {
|
|
@@ -49,9 +52,15 @@ export default class ClientChatMessage {
|
|
|
49
52
|
this.groupField = options.groupField
|
|
50
53
|
this.sortField = options.sortField
|
|
51
54
|
this.checkMessageSendResultMethod = options.checkMessageSendResultMethod
|
|
55
|
+
this.recallMessageMethod = options.recallMessageMethod
|
|
56
|
+
this.recallMessageIdField = options.recallMessageIdField
|
|
52
57
|
this.onAddMessageSuccess = options.onAddMessageSuccess
|
|
53
58
|
this.event = new Event()
|
|
54
59
|
}
|
|
60
|
+
|
|
61
|
+
setRelatedMessageService (messageService) {
|
|
62
|
+
this.relatedMessageService = messageService
|
|
63
|
+
}
|
|
55
64
|
|
|
56
65
|
getSortField (time) {
|
|
57
66
|
const step = 1000 * 60 * 60 * 24
|
|
@@ -147,6 +156,7 @@ export default class ClientChatMessage {
|
|
|
147
156
|
return
|
|
148
157
|
}
|
|
149
158
|
this.removeCheckMessageSendResultTask(id)
|
|
159
|
+
this.clearRecallState(id)
|
|
150
160
|
const message = this.messageMap[id]
|
|
151
161
|
if (!message) {
|
|
152
162
|
return
|
|
@@ -242,6 +252,7 @@ export default class ClientChatMessage {
|
|
|
242
252
|
message
|
|
243
253
|
})
|
|
244
254
|
if (rs === false) {
|
|
255
|
+
this.clearRecallState(message.id)
|
|
245
256
|
delete this.messageMap[message.id]
|
|
246
257
|
}
|
|
247
258
|
return rs
|
|
@@ -263,6 +274,8 @@ export default class ClientChatMessage {
|
|
|
263
274
|
return rs
|
|
264
275
|
}, {})
|
|
265
276
|
} else {
|
|
277
|
+
this.clearRecallTasks()
|
|
278
|
+
this.tempMessageMap = {}
|
|
266
279
|
this.data.messageData = {}
|
|
267
280
|
this.messageMap = {}
|
|
268
281
|
}
|
|
@@ -294,6 +307,139 @@ export default class ClientChatMessage {
|
|
|
294
307
|
return data
|
|
295
308
|
})
|
|
296
309
|
}
|
|
310
|
+
|
|
311
|
+
getRecallMessage (id) {
|
|
312
|
+
return this.getMessage(id) || this.tempMessageMap[id] ||
|
|
313
|
+
(this.relatedMessageService && (this.relatedMessageService.getMessage(id) || this.relatedMessageService.tempMessageMap[id]))
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
updateRecallMessage (id, props) {
|
|
317
|
+
this.updateMessage(id, props)
|
|
318
|
+
if (this.relatedMessageService) {
|
|
319
|
+
this.relatedMessageService.updateMessage(id, props)
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
clearRecallTask (id) {
|
|
324
|
+
const task = this.recallTaskMap[id]
|
|
325
|
+
if (!task) {
|
|
326
|
+
return
|
|
327
|
+
}
|
|
328
|
+
clearTimeout(task.timer)
|
|
329
|
+
delete this.recallTaskMap[id]
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
clearRecallState (id) {
|
|
333
|
+
this.clearRecallTask(id)
|
|
334
|
+
delete this.tempMessageMap[id]
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
getRecallErrorMessage (error) {
|
|
338
|
+
const responseData = error && error.response && error.response.data
|
|
339
|
+
if (responseData) {
|
|
340
|
+
return responseData.msg || responseData.message || responseData.error_description || '未知原因'
|
|
341
|
+
}
|
|
342
|
+
if (typeof error === 'string') {
|
|
343
|
+
return error
|
|
344
|
+
}
|
|
345
|
+
return (error && (error.errMsg || error.message)) || '未知原因'
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
recallMessage (params) {
|
|
349
|
+
const data = params || {}
|
|
350
|
+
const messageId = data[this.recallMessageIdField]
|
|
351
|
+
if (!this.recallMessageIdField || !messageId) {
|
|
352
|
+
return Promise.reject(new Error('缺少消息ID'))
|
|
353
|
+
}
|
|
354
|
+
if (!data.sendTime) {
|
|
355
|
+
return Promise.reject(new Error('缺少消息发送时间'))
|
|
356
|
+
}
|
|
357
|
+
if (!this.recallMessageMethod) {
|
|
358
|
+
return Promise.reject(new Error('缺少撤回消息接口配置'))
|
|
359
|
+
}
|
|
360
|
+
const message = this.getRecallMessage(messageId)
|
|
361
|
+
if (message && message.recalled) {
|
|
362
|
+
return Promise.reject(new Error('消息已撤回'))
|
|
363
|
+
}
|
|
364
|
+
if (message && message.recalling) {
|
|
365
|
+
return Promise.reject(new Error('消息正在撤回中'))
|
|
366
|
+
}
|
|
367
|
+
const requestData = {
|
|
368
|
+
[this.recallMessageIdField]: messageId,
|
|
369
|
+
sendTime: data.sendTime
|
|
370
|
+
}
|
|
371
|
+
this.clearRecallTask(messageId)
|
|
372
|
+
this.updateRecallMessage(messageId, {
|
|
373
|
+
recalling: true,
|
|
374
|
+
recallStatus: null,
|
|
375
|
+
recallResultMsg: null
|
|
376
|
+
})
|
|
377
|
+
const task = {
|
|
378
|
+
timer: setTimeout(() => {
|
|
379
|
+
if (this.recallTaskMap[messageId] !== task) {
|
|
380
|
+
return
|
|
381
|
+
}
|
|
382
|
+
delete this.recallTaskMap[messageId]
|
|
383
|
+
this.updateRecallMessage(messageId, {
|
|
384
|
+
recalling: false,
|
|
385
|
+
recallStatus: 'timeout',
|
|
386
|
+
recallResultMsg: '获取结果超时'
|
|
387
|
+
})
|
|
388
|
+
}, 10 * 1000)
|
|
389
|
+
}
|
|
390
|
+
this.recallTaskMap[messageId] = task
|
|
391
|
+
|
|
392
|
+
return Promise.resolve().then(() => this.recallMessageMethod(requestData)).catch(error => {
|
|
393
|
+
if (this.recallTaskMap[messageId] === task) {
|
|
394
|
+
this.clearRecallTask(messageId)
|
|
395
|
+
this.updateRecallMessage(messageId, {
|
|
396
|
+
recalling: false,
|
|
397
|
+
recallStatus: 'failed',
|
|
398
|
+
recallResultMsg: this.getRecallErrorMessage(error)
|
|
399
|
+
})
|
|
400
|
+
}
|
|
401
|
+
return Promise.reject(error)
|
|
402
|
+
})
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
handleMessageRecalled (data) {
|
|
406
|
+
const messageId = data && data[this.recallMessageIdField]
|
|
407
|
+
if (!messageId) {
|
|
408
|
+
return
|
|
409
|
+
}
|
|
410
|
+
this.clearRecallTask(messageId)
|
|
411
|
+
this.updateRecallMessage(messageId, {
|
|
412
|
+
recalled: true,
|
|
413
|
+
recalling: false,
|
|
414
|
+
recallStatus: null,
|
|
415
|
+
recallResultMsg: null,
|
|
416
|
+
revokeTime: data.revokeTime
|
|
417
|
+
})
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
handleMessageRecallFailed (data) {
|
|
421
|
+
const messageId = data && data[this.recallMessageIdField]
|
|
422
|
+
if (!messageId) {
|
|
423
|
+
return
|
|
424
|
+
}
|
|
425
|
+
const message = this.getRecallMessage(messageId)
|
|
426
|
+
if (message && message.recalled) {
|
|
427
|
+
return
|
|
428
|
+
}
|
|
429
|
+
this.clearRecallTask(messageId)
|
|
430
|
+
this.updateRecallMessage(messageId, {
|
|
431
|
+
recalling: false,
|
|
432
|
+
recallStatus: 'failed',
|
|
433
|
+
recallResultMsg: data.reason || '未知原因'
|
|
434
|
+
})
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
clearRecallTasks () {
|
|
438
|
+
Object.keys(this.recallTaskMap).forEach(id => {
|
|
439
|
+
clearTimeout(this.recallTaskMap[id].timer)
|
|
440
|
+
})
|
|
441
|
+
this.recallTaskMap = {}
|
|
442
|
+
}
|
|
297
443
|
|
|
298
444
|
/***
|
|
299
445
|
* 远程加载消息
|
|
@@ -363,6 +509,7 @@ export default class ClientChatMessage {
|
|
|
363
509
|
}
|
|
364
510
|
|
|
365
511
|
reset () {
|
|
512
|
+
this.clearRecallTasks()
|
|
366
513
|
this.checkMessageSendResultTaskList.forEach(task => task.cancel())
|
|
367
514
|
this.checkMessageSendResultTaskList = []
|
|
368
515
|
this.tempMessageMap = {}
|
|
@@ -16,6 +16,7 @@ export default class ClietChatSocket {
|
|
|
16
16
|
beforeFireCallback: null,
|
|
17
17
|
onCmdQwNewMessage: null,
|
|
18
18
|
onCmdQwMessageRecalled: null,
|
|
19
|
+
onCmdQwMessageRecallFailed: null,
|
|
19
20
|
onCmdQwContactInfoChanged: null,
|
|
20
21
|
onCmdQwContactRequestChanged: null,
|
|
21
22
|
onCmdQwAcceptContactRequest: null,
|
|
@@ -34,6 +35,7 @@ export default class ClietChatSocket {
|
|
|
34
35
|
this.socket = options.socket
|
|
35
36
|
this.socket.event.on('onCmdQwNewMessage', options.onCmdQwNewMessage)
|
|
36
37
|
this.socket.event.on('onCmdQwMessageRecalled', options.onCmdQwMessageRecalled)
|
|
38
|
+
this.socket.event.on('onCmdQwMessageRecallFailed', options.onCmdQwMessageRecallFailed)
|
|
37
39
|
this.socket.event.on('onCmdQwContactInfoChanged', options.onCmdQwContactInfoChanged)
|
|
38
40
|
this.socket.event.on('onCmdQwContactRequestChanged', options.onCmdQwContactRequestChanged)
|
|
39
41
|
this.socket.event.on('onCmdQwAcceptContactRequest', options.onCmdQwAcceptContactRequest)
|
|
@@ -65,21 +67,6 @@ export default class ClietChatSocket {
|
|
|
65
67
|
})
|
|
66
68
|
}
|
|
67
69
|
|
|
68
|
-
recallMessage (params) {
|
|
69
|
-
return this.sendMessage(Object.assign({
|
|
70
|
-
contactMessageId: null,
|
|
71
|
-
roomMessageId: null,
|
|
72
|
-
contactId: null,
|
|
73
|
-
roomId: null,
|
|
74
|
-
qwAccountId: null,
|
|
75
|
-
msgId: null,
|
|
76
|
-
convType: null,
|
|
77
|
-
sendTime: null
|
|
78
|
-
}, params, {
|
|
79
|
-
cmdType: 'CmdQwRecallMessage'
|
|
80
|
-
}))
|
|
81
|
-
}
|
|
82
|
-
|
|
83
70
|
connect () {
|
|
84
71
|
return this.socket.connect()
|
|
85
72
|
}
|
|
@@ -47,9 +47,10 @@ class ClientChat {
|
|
|
47
47
|
getContactsRoomGroupCountMethod: null,
|
|
48
48
|
getContactsFriendMethod: null,
|
|
49
49
|
getContactsRoomMethod: null,
|
|
50
|
-
loadFriendMessageDataMethod: null,
|
|
50
|
+
loadFriendMessageDataMethod: null,
|
|
51
51
|
loadRoomMessageDataMethod: null,
|
|
52
52
|
checkMessageSendResultMethod: null,
|
|
53
|
+
recallMessageMethod: null,
|
|
53
54
|
onOverwriteFriendInfoChange: null // 为了兼容1.0拉取会话逻辑加的,1.0暂时不支持根据taskId拉取
|
|
54
55
|
}, options)
|
|
55
56
|
if (!options.loadFriendMessageDataMethod) {
|
|
@@ -95,6 +96,8 @@ class ClientChat {
|
|
|
95
96
|
sortField: 'sendTime',
|
|
96
97
|
clientChat: this,
|
|
97
98
|
checkMessageSendResultMethod: options.checkMessageSendResultMethod,
|
|
99
|
+
recallMessageMethod: options.recallMessageMethod,
|
|
100
|
+
recallMessageIdField: 'contactMessageId',
|
|
98
101
|
onAddMessageSuccess: ({ data, isBeforeLastMessage }) => {
|
|
99
102
|
const accountId = options.getLoginAccountIdMethod ? options.getLoginAccountIdMethod() : data.qwAccountId
|
|
100
103
|
let sessionId = createSessionId(accountId, data.contactId)
|
|
@@ -175,11 +178,14 @@ class ClientChat {
|
|
|
175
178
|
return options.loadFriendMessageDataMethod(params)
|
|
176
179
|
}
|
|
177
180
|
})
|
|
181
|
+
this.friendMessage.setRelatedMessageService(this.friendMessageFilter)
|
|
178
182
|
this.roomMessage = new ClientChatMessage({
|
|
179
183
|
groupField: 'roomId',
|
|
180
184
|
sortField: 'sendTime',
|
|
181
185
|
clientChat: this,
|
|
182
186
|
checkMessageSendResultMethod: options.checkMessageSendResultMethod,
|
|
187
|
+
recallMessageMethod: options.recallMessageMethod,
|
|
188
|
+
recallMessageIdField: 'roomMessageId',
|
|
183
189
|
onAddMessageSuccess: ({ data, isBeforeLastMessage }) => {
|
|
184
190
|
const accountId = options.getLoginAccountIdMethod ? options.getLoginAccountIdMethod() : data.qwAccountId
|
|
185
191
|
let sessionId = createSessionId(accountId, data.roomId)
|
|
@@ -261,6 +267,7 @@ class ClientChat {
|
|
|
261
267
|
return options.loadRoomMessageDataMethod(params)
|
|
262
268
|
}
|
|
263
269
|
})
|
|
270
|
+
this.roomMessage.setRelatedMessageService(this.roomMessageFilter)
|
|
264
271
|
this.contacts = new ClientChatContacts({
|
|
265
272
|
loadContactsRoomGroupDataMethod: options.loadContactsRoomGroupDataMethod,
|
|
266
273
|
loadContactsFriendGroupDataMethod: options.loadContactsFriendGroupDataMethod,
|
|
@@ -405,17 +412,17 @@ class ClientChat {
|
|
|
405
412
|
}
|
|
406
413
|
},
|
|
407
414
|
onCmdQwMessageRecalled: ({ data }) => {
|
|
408
|
-
if (
|
|
409
|
-
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
recalled: true,
|
|
413
|
-
revokeTime: data.revokeTime
|
|
415
|
+
if (data && data.contactMessageId) {
|
|
416
|
+
this.friendMessage.handleMessageRecalled(data)
|
|
417
|
+
} else if (data && data.roomMessageId) {
|
|
418
|
+
this.roomMessage.handleMessageRecalled(data)
|
|
414
419
|
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
this.
|
|
420
|
+
},
|
|
421
|
+
onCmdQwMessageRecallFailed: ({ data }) => {
|
|
422
|
+
if (data && data.contactMessageId) {
|
|
423
|
+
this.friendMessage.handleMessageRecallFailed(data)
|
|
424
|
+
} else if (data && data.roomMessageId) {
|
|
425
|
+
this.roomMessage.handleMessageRecallFailed(data)
|
|
419
426
|
}
|
|
420
427
|
},
|
|
421
428
|
// 会话失效
|