@aochuang/client-sdk 1.0.379-wework → 1.0.379-wework-2

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.
@@ -26,6 +26,7 @@ export const MESSAGE_TYPE = {
26
26
  // REVOKE_YOU_MESSAGE: 285222674,
27
27
  // REVOKE_OTHER_MESSAGE: 268445456,
28
28
  JX_SYS_TEXT: 1000,
29
+ QW_SYS_TEXT: 90000,
29
30
  // MEMBER_CHANGE: 570425393,
30
31
  // SYSTEM_MONEY: -10001,
31
32
  // TIME_DIVIDER: -12346789,
@@ -108,6 +109,9 @@ export function formatShortMessage (msgType, msgContent) {
108
109
  case MESSAGE_TYPE.MUSIC:
109
110
  shortMessage = '[音乐消息]'
110
111
  break
112
+ case MESSAGE_TYPE.QW_SYS_TEXT:
113
+ shortMessage = getTextContent(msgContent)
114
+ break
111
115
  case MESSAGE_TYPE.JX_SYS_TEXT:
112
116
  case MESSAGE_TYPE.MEMBER_CHANGE:
113
117
  case MESSAGE_TYPE.SYSTEM_MONEY:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aochuang/client-sdk",
3
- "version": "1.0.379-wework",
3
+ "version": "1.0.379-wework-2",
4
4
  "description": "",
5
5
  "files": [
6
6
  "common",
@@ -15,6 +15,7 @@ export default class ClietChatSocket {
15
15
  // 执行回调事件前的方法
16
16
  beforeFireCallback: null,
17
17
  onCmdQwNewMessage: null,
18
+ onCmdQwMessageRecalled: null,
18
19
  onCmdQwContactInfoChanged: null,
19
20
  onCmdQwContactRequestChanged: null,
20
21
  onCmdQwAcceptContactRequest: null,
@@ -32,6 +33,7 @@ export default class ClietChatSocket {
32
33
  }
33
34
  this.socket = options.socket
34
35
  this.socket.event.on('onCmdQwNewMessage', options.onCmdQwNewMessage)
36
+ this.socket.event.on('onCmdQwMessageRecalled', options.onCmdQwMessageRecalled)
35
37
  this.socket.event.on('onCmdQwContactInfoChanged', options.onCmdQwContactInfoChanged)
36
38
  this.socket.event.on('onCmdQwContactRequestChanged', options.onCmdQwContactRequestChanged)
37
39
  this.socket.event.on('onCmdQwAcceptContactRequest', options.onCmdQwAcceptContactRequest)
@@ -404,6 +404,20 @@ class ClientChat {
404
404
  this.roomMessage.addMessage(data.roomMessage)
405
405
  }
406
406
  },
407
+ onCmdQwMessageRecalled: ({ data }) => {
408
+ if (!data) {
409
+ return
410
+ }
411
+ const recalled = {
412
+ recalled: true,
413
+ revokeTime: data.revokeTime
414
+ }
415
+ if (Number(data.convType) === 0 && data.contactMessageId) {
416
+ this.friendMessage.updateMessage(data.contactMessageId, recalled)
417
+ } else if (Number(data.convType) === 1 && data.roomMessageId) {
418
+ this.roomMessage.updateMessage(data.roomMessageId, recalled)
419
+ }
420
+ },
407
421
  // 会话失效
408
422
  onCmdCmdKickOut: () => {
409
423
  // 一般可能同一个账号在其他设备登录,这种情况需要重新登录