Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

获取contact类型message的contact时,id异常 #136

Closed
Tracked by #19
hcfw007 opened this issue Feb 8, 2022 · 2 comments
Closed
Tracked by #19

获取contact类型message的contact时,id异常 #136

hcfw007 opened this issue Feb 8, 2022 · 2 comments
Assignees

Comments

@hcfw007
Copy link
Member

hcfw007 commented Feb 8, 2022

15:47:35 INFO Message Listener {"_events":{},"_eventsCount":0,"id":"40FA476C3B8BB726488C374DA3E3BCC5","payload":{"fromId":"8613811286503@c.us","id":"40FA476C3B8BB726488C374DA3E3BCC5","mentionIdList":[],"roomId":"120363039010379837@g.us","text":"BEGIN:VCARD\nVERSION:3.0\nN:;MyOnlyStarCN;;;\nFN:MyOnlyStarCN\nitem1.TEL;waid=8618500946096:+86 185 0094 6096\nitem1.X-ABLabel:手机\nEND:VCARD","timestamp":1644306455,"type":3}}
15:47:36 VERB Contact friend()
15:47:36 VERB Puppet selfId()
15:47:36 VERB Puppet selfId()
15:47:36 VERB Message mentionList()
15:47:36 VERB Room topic()
15:47:36 VERB Puppet roomMemberPayload(roomId=120363039010379837@g.us, memberId=8613811286503@c.us)
15:47:36 VERB Room topic()
15:47:36 VERB Message toContact()
15:47:36 INFO PuppetWhatsApp messageContact(40FA476C3B8BB726488C374DA3E3BCC5)
15:47:36 VERB FlashStore get(40FA476C3B8BB726488C374DA3E3BCC5)
15:47:36 WARN SaveMsg getPayload() retry, 3 reties left. error:
please check contact id: 8618500946096 again.
15:47:36 VERB PuppetWhatsApp contactRawPayload(8618500946096)
15:47:36 VERB Contact ready() this.wechaty.puppet.contactPayload(8618500946096) exception: please check contact id: 8618500946096 again.

目前toContact返回的是vcard.TEL.waid,并不等于contactId,因此名片消息会无法获取到联系人。
需要根据电话区域进行处理。

@su-chang su-chang mentioned this issue Feb 8, 2022
42 tasks
@su-chang
Copy link
Member

su-chang commented Feb 8, 2022

Card Data Example

we can only support Card Data now.

Card Data in android

{
  "id": {
    "fromMe": false,
    "remote": "8613811286503@c.us",
    "id": "047EFABBFA17B5ACEAEA85078BDBEC6D",
    "_serialized": "false_8613811286503@c.us_047EFABBFA17B5ACEAEA85078BDBEC6D"
  },
  "ack": 0,
  "hasMedia": false,
  "body": "BEGIN:VCARD\nVERSION:3.0\nN:康;龙;;;\nFN:康龙\nitem1.TEL;waid=8613240330438:+86 132 4033 0438\nitem1.X-ABLabel:手机\nEND:VCARD",
  "type": "vcard",
  "timestamp": 1644311966,
  "from": "8613811286503@c.us",
  "to": "8613126768525@c.us",
  "deviceType": "android",
  "isForwarded": false,
  "forwardingScore": 0,
  "isStatus": false,
  "isStarred": false,
  "broadcast": false,
  "fromMe": false,
  "hasQuotedMsg": false,
  "vCards": ["BEGIN:VCARD\nVERSION:3.0\nN:康;龙;;;\nFN:康龙\nitem1.TEL;waid=8613240330438:+86 132 4033 0438\nitem1.X-ABLabel:手机\nEND:VCARD"],
  "mentionedIds": [],
  "isGif": false,
  "isEphemeral": false,
  "links": []
}

Card Data in ios

{
  "id": {
    "fromMe": false,
    "remote": "8613126768525@c.us",
    "id": "3A947F5E900D758205DD",
    "_serialized": "false_8613126768525@c.us_3A947F5E900D758205DD"
  },
  "ack": 0,
  "hasMedia": false,
  "body": "BEGIN:VCARD\nVERSION:3.0\nN:🐉;socialbear;;;\nFN:socialbear 🐉\nTEL;type=CELL;type=VOICE;waid=8613240330438:+86 132 4033 0438\nEND:VCARD",
  "type": "vcard",
  "timestamp": 1644397571,
  "from": "8613126768525@c.us",
  "to": "8618500946096@c.us",
  "deviceType": "ios",
  "isForwarded": false,
  "forwardingScore": 0,
  "isStatus": false,
  "isStarred": false,
  "broadcast": false,
  "fromMe": false,
  "hasQuotedMsg": false,
  "vCards": ["BEGIN:VCARD\nVERSION:3.0\nN:🐉;socialbear;;;\nFN:socialbear 🐉\nTEL;type=CELL;type=VOICE;waid=8613240330438:+86 132 4033 0438\nEND:VCARD"],
  "mentionedIds": [],
  "isGif": false,
  "isEphemeral": false,
  "links": []
}

Card Data with multi phones

{
  "id": {
    "fromMe": false,
    "remote": "8613811286503@c.us",
    "id": "6B724F1DBE10899753FF79DE3EA30811",
    "_serialized": "false_8613811286503@c.us_6B724F1DBE10899753FF79DE3EA30811"
  },
  "ack": 0,
  "hasMedia": false,
  "body": "BEGIN:VCARD\nVERSION:3.0\nN:测试企业9Group;Chatie多人通话;;;\nFN:Chatie多人通话\nitem1.TEL:+86 24 6278 1276\nitem1.X-ABLabel:公费电话\nitem2.TEL:+52 729739\nitem2.X-ABLabel:公费电话\nEND:VCARD",
  "type": "vcard",
  "timestamp": 1644312095,
  "from": "8613811286503@c.us",
  "to": "8613126768525@c.us",
  "deviceType": "android",
  "isForwarded": false,
  "forwardingScore": 0,
  "isStatus": false,
  "isStarred": false,
  "broadcast": false,
  "fromMe": false,
  "hasQuotedMsg": false,
  "vCards": ["BEGIN:VCARD\nVERSION:3.0\nN:测试企业9Group;Chatie多人通话;;;\nFN:Chatie多人通话\nitem1.TEL:+86 24 6278 1276\nitem1.X-ABLabel:公费电话\nitem2.TEL:+52 729739\nitem2.X-ABLabel:公费电话\nEND:VCARD"],
  "mentionedIds": [],
  "isGif": false,
  "isEphemeral": false,
  "links": []
}

MultiCard Data

{
  "id": {
    "fromMe": true,
    "remote": "8613811286503@c.us",
    "id": "3A830BF73087042F345C",
    "_serialized": "true_8613811286503@c.us_3A830BF73087042F345C"
  },
  "ack": 0,
  "hasMedia": false,
  "body": "",
  "type": "multi_vcard",
  "timestamp": 1644311381,
  "from": "8613126768525@c.us",
  "to": "8613811286503@c.us",
  "deviceType": "ios",
  "isForwarded": false,
  "forwardingScore": 0,
  "isStatus": false,
  "isStarred": false,
  "fromMe": true,
  "hasQuotedMsg": false,
  "vCards": ["BEGIN:VCARD\nVERSION:3.0\nN:;MyOnlyStarCN;;;\nFN:MyOnlyStarCN\nTEL;type=CELL;type=VOICE;waid=8618500946096:+86 185 0094 6096\nEND:VCARD", "BEGIN:VCARD\nVERSION:3.0\nN:;苏畅;;;\nFN:苏畅\nTEL;type=CELL;type=VOICE;waid=8613126768525:+8613126768525\nEND:VCARD", "BEGIN:VCARD\nVERSION:3.0\nN:;Kelly;;;\nFN:Kelly\nTEL;type=CELL;type=VOICE;waid=8617316842524:+86 173 1684 2524\nEND:VCARD", "BEGIN:VCARD\nVERSION:3.0\nN:;Friday Bot;;;\nFN:Friday Bot\nTEL;type=CELL;type=VOICE;waid=8613811286503:+86 138 1128 6503\nEND:VCARD"],
  "mentionedIds": [],
  "isGif": false,
  "isEphemeral": false,
  "links": []
}

This was referenced Feb 8, 2022
@su-chang su-chang closed this as completed Feb 8, 2022
@su-chang su-chang reopened this Feb 9, 2022
@su-chang
Copy link
Member

su-chang commented Feb 9, 2022

Should parse contact message from ios device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants