@aochuang/client-sdk 1.0.279 → 1.0.280

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aochuang/client-sdk",
3
- "version": "1.0.279",
3
+ "version": "1.0.280",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -388,9 +388,9 @@ export default class ClientChatAccount {
388
388
  return new Error('getAccountGreetingUnreadMsgCountMethod未定义')
389
389
  }
390
390
  return this.getAccountGreetingUnreadMsgCountMethod({
391
- wechatAccountId: params.wechatAccountId
391
+ wechatAccountId: (params || {}).wechatAccountId
392
392
  }).then(rs => {
393
- Vue.set(this.accountGreetingUnreadMsgCountData, params.wechatAccountId || 'all', (rs || {}).data || 0)
393
+ Vue.set(this.accountGreetingUnreadMsgCountData, (params || {}).wechatAccountId || 'all', (rs || {}).data || 0)
394
394
  })
395
395
  }
396
396
 
@@ -27,6 +27,7 @@ export default class Websocket {
27
27
  onCmdChatroomInvite: null,
28
28
  onCmdNewGreetingMsg: null,
29
29
  onCmdNewFriendRequest: null,
30
+ onCmdFriendAccepted: null,
30
31
  onHeartbeatCheck: null,
31
32
  onHeartbeatSuccess: null,
32
33
  onSendMessage: null,
@@ -110,6 +111,11 @@ export default class Websocket {
110
111
  options.onCmdNewFriendRequest(evt)
111
112
  }
112
113
  })
114
+ this.socket.event.on('onCmdFriendAccepted', (evt) => {
115
+ if (!options.checkSocketEventNotifyMethod || options.checkSocketEventNotifyMethod(evt) !== false) {
116
+ options.onCmdFriendAccepted(evt)
117
+ }
118
+ })
113
119
  this.socket.event.on('onCmdMessageRecalled', options.onCmdMessageRecalled)
114
120
  this.socket.event.on('onHeartbeatCheck', ({ mergeParams }) => {
115
121
  options.onHeartbeatCheck && options.onHeartbeatCheck({
@@ -931,7 +931,7 @@ class ClientChat {
931
931
  }
932
932
  },
933
933
  // 打招呼有变化
934
- onCmdNewGreetingMsg: ({ data }) => {
934
+ onCmdNewGreetingMsg: ({ data }) => {
935
935
  // {
936
936
  // "cmdType": "CmdNewGreetingMsg",
937
937
  // "seq": 440013669,
@@ -945,10 +945,24 @@ class ClientChat {
945
945
  })
946
946
  },
947
947
  onCmdNewFriendRequest: ({ data }) => {
948
- // 刷新未读
949
- this.account.getAccountGreetingUnreadMsgCount({
950
- wechatAccountId: data.wechatAccountId
951
- })
948
+ // 刷新指定微信号请求数量
949
+ if (data.wechatAccountId) {
950
+ this.account.getAccountGreetingUnreadMsgCount({
951
+ wechatAccountId: data.wechatAccountId
952
+ })
953
+ }
954
+ // 刷新所有微信号请求数量
955
+ this.account.getAccountGreetingUnreadMsgCount()
956
+ },
957
+ onCmdFriendAccepted: ({ data }) => {
958
+ // 刷新指定微信号请求数量
959
+ if (data.wechatAccountId) {
960
+ this.account.getAccountGreetingUnreadMsgCount({
961
+ wechatAccountId: data.wechatAccountId
962
+ })
963
+ }
964
+ // 刷新所有微信号请求数量
965
+ this.account.getAccountGreetingUnreadMsgCount()
952
966
  },
953
967
  onHeartbeatCheck: ({ mergeParams }) => {
954
968
  const ids = this.account.getAccountData().map(v => v.id)