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

需要详细测试下创建群组的前提条件 #159

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

需要详细测试下创建群组的前提条件 #159

su-chang opened this issue Feb 10, 2022 · 1 comment
Assignees

Comments

@su-chang
Copy link
Member

su-chang commented Feb 10, 2022

目前来看,只能拉取通讯录中的whatsapp好友才能创建群聊。

如果创建群聊是选择多人(A,B,C,D),A和B是好友,C和D是发过消息的联系人。此时创建出来的群聊中只有三个成员(不包含C,D)。

可能需要重新调整下好友关系的判定逻辑。目前是所有可以聊天的手机号都认作为好友。#121

@su-chang
Copy link
Member Author

Case 1

以好友和非好友一起创建群聊,只有好友被创建到群聊中。

const roomId = await puppet.roomCreate([
  SUCHANG,
  ZHOU_PENG,
  KELLY,
  DONGHAO,
  RUI_TEST,
], `create room by api ${Math.floor(Math.random() * 1000)}`)
const roomRawPayload = await puppet.roomRawPayload(roomId)
const roomPayload = await puppet.roomRawPayloadParser(roomRawPayload)

日志

14:47:10 INFO PuppetWhatsApp roomCreate(8613126768525@c.us,8618710175700@c.us,8617316842524@c.us,8613351873428@c.us,8613810195807@c.us, create room by api 596)
14:47:11 VERB PuppetWhatsApp roomRawPayload(120363039829707440@g.us)
14:47:11 VERB FlashStore get(120363039829707440@g.us)
14:47:11 INFO PuppetWhatsApp onRoomUpdate({"id":{"fromMe":false,"remote":"120363039829707440@g.us","id":"3A18AC4F22F01DF18E6C","participant":"8613126768525@c.us","_serialized":"false_120363039829707440@g.us_3A18AC4F22F01DF18E6C_8613126768525@c.us"},"body":"create room by api 596","type":"create","timestamp":1644475631,"chatId":"8613126768525@c.us","author":"8613126768525@c.us","recipientIds":[]})
14:47:11 VERB FlashStore get(120363039829707440@g.us)
14:47:11 VERB FlashStore set(120363039829707440@g.us, [object Object]) value type: object

      ========================
      roomPayload: {"adminIdList":["8613126768525@c.us"],"avatar":"","id":"120363039829707440@g.us","memberIdList":["8618710175700@c.us","8617316842524@c.us","8613126768525@c.us"],"ownerId":"8613126768525@c.us","topic":""}
      ========================

Case 2

以好友创建群聊,群聊创建成功后,再拉非好友进入群聊。

const roomId = await puppet.roomCreate([
  SUCHANG,
  ZHOU_PENG,
  KELLY,
], `create room by api ${Math.floor(Math.random() * 1000)}`)
const createRoomRawPayload = await puppet.roomRawPayload(roomId)
const createRoomPayload = await puppet.roomRawPayloadParser(createRoomRawPayload)
console.info(`
========================
createRoomPayload: ${JSON.stringify(createRoomPayload)}
========================
`)
await puppet.roomAdd(roomId, DONGHAO)
await puppet.roomAdd(roomId, RUI_TEST)
const addRoomRawPayload = await puppet.roomRawPayload(roomId)
const addRoomPayload = await puppet.roomRawPayloadParser(addRoomRawPayload)
console.info(`
========================
addRoomPayload: ${JSON.stringify(addRoomPayload)}
========================
`)

日志

14:40:46 INFO PuppetWhatsApp roomCreate(8613126768525@c.us,8618710175700@c.us,8617316842524@c.us, create room by api 994)
14:40:47 VERB PuppetWhatsApp roomRawPayload(120363023645482433@g.us)
14:40:47 VERB FlashStore get(120363023645482433@g.us)
14:40:48 INFO PuppetWhatsApp onRoomUpdate({"id":{"fromMe":false,"remote":"120363023645482433@g.us","id":"3A66C4CB5A93DD6D6BA0","participant":"8613126768525@c.us","_serialized":"false_120363023645482433@g.us_3A66C4CB5A93DD6D6BA0_8613126768525@c.us"},"body":"create room by api 994","type":"create","timestamp":1644475247,"chatId":"8613126768525@c.us","author":"8613126768525@c.us","recipientIds":[]})
14:40:48 VERB FlashStore get(120363023645482433@g.us)
14:40:48 VERB FlashStore set(120363023645482433@g.us, [object Object]) value type: object
14:40:48 VERB FlashStore get(3EB08E381AD3D758816A)

      ========================
      createRoomPayload: {"adminIdList":["8613126768525@c.us"],"avatar":"","id":"120363023645482433@g.us","memberIdList":["8618710175700@c.us","8617316842524@c.us","8613126768525@c.us"],"ownerId":"8613126768525@c.us","topic":""}
      ========================

14:40:48 INFO PuppetWhatsApp roomAdd(120363023645482433@g.us, 8613351873428@c.us)
14:40:48 VERB FlashStore set(120363023645482433@g.us, [object Object]) value type: object
14:40:48 VERB Puppet dirtyPayload(Room<3>, 8613126768525@c.us)
14:40:48 VERB Puppet dirtyPayloadRoom(8613126768525@c.us)
14:40:49 VERB FlashStore get(120363023645482433@g.us)
14:40:49 VERB FlashStore set(120363023645482433@g.us, 8613351873428@c.us) value type: object
14:40:49 INFO PuppetWhatsApp roomAdd(120363023645482433@g.us, 8613810195807@c.us)
14:40:50 INFO PuppetWhatsApp onRoomJoin({"id":{"fromMe":false,"remote":"120363023645482433@g.us","id":"3AADA2FA059C9C5D654F","participant":"8613351873428@c.us","_serialized":"false_120363023645482433@g.us_3AADA2FA059C9C5D654F_8613351873428@c.us"},"body":"","type":"add","timestamp":1644475249,"chatId":"8613126768525@c.us","author":"8613126768525@c.us","recipientIds":["8613351873428@c.us"]})
14:40:50 VERB FlashStore get(120363023645482433@g.us)
14:40:50 VERB FlashStore set(120363023645482433@g.us, 8613351873428@c.us) value type: object
14:40:50 VERB Puppet dirtyPayload(Room<3>, 120363023645482433@g.us)
14:40:50 VERB Puppet dirtyPayloadRoom(120363023645482433@g.us)
14:40:51 VERB FlashStore get(120363023645482433@g.us)
14:40:51 VERB FlashStore set(120363023645482433@g.us, 8613351873428@c.us,8613810195807@c.us) value type: object
14:40:51 VERB PuppetWhatsApp roomRawPayload(120363023645482433@g.us)
14:40:51 VERB FlashStore get(120363023645482433@g.us)

      ========================
      addRoomPayload: {"adminIdList":["8613126768525@c.us"],"id":"120363023645482433@g.us","memberIdList":["8618710175700@c.us","8617316842524@c.us","8613351873428@c.us","8613810195807@c.us","8613126768525@c.us"],"ownerId":"8613126768525@c.us","topic":""}
      ========================

@su-chang su-chang self-assigned this Feb 10, 2022
This was referenced Feb 10, 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