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

消息撤回成功后,会接收到确认的事件。并以unknown消息类型emit到wechaty层。 #130

Closed
Tracked by #19
su-chang opened this issue Feb 7, 2022 · 1 comment

Comments

@su-chang
Copy link
Member

su-chang commented Feb 7, 2022

问题

需要将 type: 'revoke' 的类型转换为RECALL类型的消息。但是在 onMessageRevokeEveryone 事件中,newMsg 和 revokedMsg 的id相同,导致无法判别出具体撤回的是哪条消息。

案例一

18: 15: 07 SILL PuppetWhatsApp onMessageRevokeEveryone(
newMsg: {
  "id": {
    "fromMe": true,
    "remote": "[email protected]",
    "id": "3EB0063979CAD97A2FD5",
    "_serialized": "[email protected]_3EB0063979CAD97A2FD5"
  },
  "ack": -1,
  "hasMedia": false,
  "body": "",
  "type": "revoked",
  "timestamp": 1644228906,
  "from": "[email protected]",
  "to": "[email protected]",
  "deviceType": "web",
  "isForwarded": false,
  "forwardingScore": 0,
  "isStatus": false,
  "isStarred": false,
  "fromMe": true,
  "hasQuotedMsg": false,
  "vCards": [],
  "mentionedIds": [],
  "isGif": false,
  "isEphemeral": false,
  "links": []
}),
revokedMsg: {
  "id": {
    "fromMe": true,
    "remote": "[email protected]",
    "id": "3EB0063979CAD97A2FD5",
    "_serialized": "[email protected]_3EB0063979CAD97A2FD5"
  },
  "ack": -1,
  "hasMedia": false,
  "body": "dong",
  "type": "chat",
  "timestamp": 1644228906,
  "from": "[email protected]",
  "to": "[email protected]",
  "deviceType": "web",
  "isForwarded": false,
  "forwardingScore": 0,
  "isStatus": false,
  "isStarred": false,
  "fromMe": true,
  "hasQuotedMsg": false,
  "vCards": [],
  "mentionedIds": [],
  "isGif": false,
  "isEphemeral": false,
  "links": []
}
18: 15: 09 SILL PuppetWhatsApp onMessageAck({
  "id": {
    "fromMe": true,
    "remote": "[email protected]",
    "id": "3EB0063979CAD97A2FD5",
    "_serialized": "[email protected]_3EB0063979CAD97A2FD5"
  },
  "ack": 2,
  "hasMedia": false,
  "body": "",
  "type": "revoked",
  "timestamp": 1644228906,
  "from": "[email protected]",
  "to": "[email protected]",
  "deviceType": "web",
  "isForwarded": false,
  "forwardingScore": 0,
  "isStatus": false,
  "isStarred": false,
  "fromMe": true,
  "hasQuotedMsg": false,
  "vCards": [],
  "mentionedIds": [],
  "isGif": false,
  "isEphemeral": false,
  "links": []
})
18: 15: 09 VERB FlashStore get(3 EB0063979CAD97A2FD5)
18: 15: 09 VERB FlashStore set(3 EB0063979CAD97A2FD5, [object Object]) value type: object
18: 15: 09 INFO PuppetWhatsApp onMessage({
  "messageId": "3EB0063979CAD97A2FD5"
})
18: 15: 09 VERB Puppet messagePayload(3 EB0063979CAD97A2FD5)
18: 15: 09 SILL Puppet messagePayloadCache(3 EB0063979CAD97A2FD5) cache MISS
18: 15: 09 INFO PuppetWhatsApp messageRawPayload(3 EB0063979CAD97A2FD5)

案例二

18: 56: 25 SILL PuppetWhatsApp onMessageCreate({
  "id": {
    "fromMe": true,
    "remote": "[email protected]",
    "id": "F9977B27F97B119F3F9B5E7298986114",
    "_serialized": "[email protected]_F9977B27F97B119F3F9B5E7298986114"
  },
  "ack": 0,
  "hasMedia": false,
  "body": "www.baidu.com",
  "type": "chat",
  "timestamp": 1644231385,
  "from": "[email protected]",
  "to": "[email protected]",
  "deviceType": "android",
  "isForwarded": false,
  "forwardingScore": 0,
  "isStatus": false,
  "isStarred": false,
  "fromMe": true,
  "hasQuotedMsg": false,
  "vCards": [],
  "mentionedIds": [],
  "isGif": false,
  "isEphemeral": false,
  "title": "百度一下,你就知道",
  "description": "全球领先的中文搜索引擎、致力于让网民更便捷地获取信息,找到所求。百度超过千亿的中文网页数据库,可以瞬间找到相关的搜索结果。",
  "links": [{
    "link": "http://www.baidu.com",
    "isSuspicious": false
  }]
})

18: 56: 27 SILL PuppetWhatsApp onMessageRevokeEveryone(
newMsg: {
  "id": {
    "fromMe": true,
    "remote": "[email protected]",
    "id": "3EB0296B7264E0E99467",
    "_serialized": "[email protected]_3EB0296B7264E0E99467"
  },
  "ack": 0,
  "hasMedia": false,
  "body": "",
  "type": "revoked",
  "timestamp": 1644231385,
  "from": "[email protected]",
  "to": "[email protected]",
  "deviceType": "web",
  "isForwarded": false,
  "forwardingScore": 0,
  "isStatus": false,
  "isStarred": false,
  "fromMe": true,
  "hasQuotedMsg": false,
  "vCards": [],
  "mentionedIds": [],
  "isGif": false,
  "isEphemeral": false,
  "links": [{
    "link": "http://www.baidu.com",
    "isSuspicious": false
  }]
}),
revokedMsg: {
  "id": {
    "fromMe": true,
    "remote": "[email protected]",
    "id": "3EB0296B7264E0E99467",
    "_serialized": "[email protected]_3EB0296B7264E0E99467"
  },
  "ack": 0,
  "hasMedia": false,
  "body": "www.baidu.com",
  "type": "chat",
  "timestamp": 1644231385,
  "from": "[email protected]",
  "to": "[email protected]",
  "deviceType": "web",
  "isForwarded": false,
  "forwardingScore": 0,
  "isStatus": false,
  "isStarred": false,
  "fromMe": true,
  "hasQuotedMsg": false,
  "vCards": [],
  "mentionedIds": [],
  "isGif": false,
  "isEphemeral": false,
  "title": "百度一下,你就知道",
  "description": "全球领先的中文搜索引擎、致力于让网民更便捷地获取信息,找到所求。百度超过千亿的中文网页数据库,可以瞬间找到相关的搜索结果。",
  "links": [{
    "link": "http://www.baidu.com",
    "isSuspicious": false
  }]
}

18: 56: 28 SILL PuppetWhatsApp onMessageAck({
  "id": {
    "fromMe": true,
    "remote": "[email protected]",
    "id": "3EB0296B7264E0E99467",
    "_serialized": "[email protected]_3EB0296B7264E0E99467"
  },
  "ack": 2,
  "hasMedia": false,
  "body": "",
  "type": "revoked",
  "timestamp": 1644231385,
  "from": "[email protected]",
  "to": "[email protected]",
  "deviceType": "web",
  "isForwarded": false,
  "forwardingScore": 0,
  "isStatus": false,
  "isStarred": false,
  "fromMe": true,
  "hasQuotedMsg": false,
  "vCards": [],
  "mentionedIds": [],
  "isGif": false,
  "isEphemeral": false,
  "links": [{
    "link": "http://www.baidu.com",
    "isSuspicious": false
  }]
})
@su-chang su-chang changed the title 消息撤回成功后,会接收到确认的事件。 消息撤回成功后,会接收到确认的事件。并以unknown消息类型emit到wechaty层。 Feb 7, 2022
@su-chang
Copy link
Member Author

su-chang commented Feb 7, 2022

Related issue: pedroslopez/whatsapp-web.js#1178

This was referenced Feb 7, 2022
@su-chang su-chang closed this as completed Feb 8, 2022
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

1 participant