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([email protected],[email protected],[email protected],[email protected],[email protected], create room by api 596)
14:47:11 VERB PuppetWhatsApp roomRawPayload([email protected])
14:47:11 VERB FlashStore get([email protected])
14:47:11 INFO PuppetWhatsApp onRoomUpdate({"id":{"fromMe":false,"remote":"[email protected]","id":"3A18AC4F22F01DF18E6C","participant":"[email protected]","_serialized":"[email protected][email protected]"},"body":"create room by api 596","type":"create","timestamp":1644475631,"chatId":"[email protected]","author":"[email protected]","recipientIds":[]})
14:47:11 VERB FlashStore get([email protected])
14:47:11 VERB FlashStore set([email protected], [object Object]) value type: object

      ========================
      roomPayload: {"adminIdList":["[email protected]"],"avatar":"","id":"[email protected]","memberIdList":["[email protected]","[email protected]","[email protected]"],"ownerId":"[email protected]","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([email protected],[email protected],[email protected], create room by api 994)
14:40:47 VERB PuppetWhatsApp roomRawPayload([email protected])
14:40:47 VERB FlashStore get([email protected])
14:40:48 INFO PuppetWhatsApp onRoomUpdate({"id":{"fromMe":false,"remote":"[email protected]","id":"3A66C4CB5A93DD6D6BA0","participant":"[email protected]","_serialized":"[email protected][email protected]"},"body":"create room by api 994","type":"create","timestamp":1644475247,"chatId":"[email protected]","author":"[email protected]","recipientIds":[]})
14:40:48 VERB FlashStore get([email protected])
14:40:48 VERB FlashStore set([email protected], [object Object]) value type: object
14:40:48 VERB FlashStore get(3EB08E381AD3D758816A)

      ========================
      createRoomPayload: {"adminIdList":["[email protected]"],"avatar":"","id":"[email protected]","memberIdList":["[email protected]","[email protected]","[email protected]"],"ownerId":"[email protected]","topic":""}
      ========================

14:40:48 INFO PuppetWhatsApp roomAdd([email protected], [email protected])
14:40:48 VERB FlashStore set([email protected], [object Object]) value type: object
14:40:48 VERB Puppet dirtyPayload(Room<3>, [email protected])
14:40:48 VERB Puppet dirtyPayloadRoom([email protected])
14:40:49 VERB FlashStore get([email protected])
14:40:49 VERB FlashStore set([email protected], [email protected]) value type: object
14:40:49 INFO PuppetWhatsApp roomAdd([email protected], [email protected])
14:40:50 INFO PuppetWhatsApp onRoomJoin({"id":{"fromMe":false,"remote":"[email protected]","id":"3AADA2FA059C9C5D654F","participant":"[email protected]","_serialized":"[email protected][email protected]"},"body":"","type":"add","timestamp":1644475249,"chatId":"[email protected]","author":"[email protected]","recipientIds":["[email protected]"]})
14:40:50 VERB FlashStore get([email protected])
14:40:50 VERB FlashStore set([email protected], [email protected]) value type: object
14:40:50 VERB Puppet dirtyPayload(Room<3>, [email protected])
14:40:50 VERB Puppet dirtyPayloadRoom([email protected])
14:40:51 VERB FlashStore get([email protected])
14:40:51 VERB FlashStore set([email protected], [email protected],[email protected]) value type: object
14:40:51 VERB PuppetWhatsApp roomRawPayload([email protected])
14:40:51 VERB FlashStore get([email protected])

      ========================
      addRoomPayload: {"adminIdList":["[email protected]"],"id":"[email protected]","memberIdList":["[email protected]","[email protected]","[email protected]","[email protected]","[email protected]"],"ownerId":"[email protected]","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