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

BREAKING CHANGE: first arg of room-leave event licener changed from Contact to Contact[] #723

Closed
lijiarui opened this issue Aug 11, 2017 · 3 comments

Comments

@lijiarui
Copy link
Member

lijiarui commented Aug 11, 2017

room-leave has update according: #250 #370
It structures as follows:

.on('room-leave', function(this, room, leaver, remover) {
  log.info('Bot', 'EVENT: room-leave - Room %s lost member %s by %s'
                , room.topic()
                , leaverList.map(c => c.name()).join(',')
                , remover.name()
              )
})

But in src/wechaty.ts, it says:

  public on(event: 'room-leave' , listener: (this: Wechaty, room: Room, leaverList: Contact[]) => void): this

In src/room.ts, it says:

public on(event: 'leave', listener: (this: Room, leaver: Contact) => void): this

This is old version of room-leave

@huan
Copy link
Member

huan commented Aug 18, 2017

It should be synced when we merge your PR #370

Could you please to submit a PR to fix this? Thanks.

@huan huan added the bug label Aug 18, 2017
@lijiarui lijiarui self-assigned this Aug 18, 2017
@binsee
Copy link

binsee commented Aug 18, 2017

Related Information

in src/puppt-web/firer.ts:

  /**
   * FIXME: leaver maybe is a list
   * @lijiarui: I have checked, leaver will never be a list. If the bot remove 2 leavers at the same time, it will be 2 sys message, instead of 1 sys message contains 2 leavers.
   */
  this.emit('room-leave', room, leaverContact, removerContact)
  room.emit('leave'           , leaverContact, removerContact)

@huan
Copy link
Member

huan commented Aug 19, 2017

To make the API be consist, I'd like to suggest we always use contactList s parameters.

@huan huan changed the title wechaty.ts room-leave event should adjust the new version BREAKING CHANGE: first arg of room-leave event licener changed from Contact to Contact[] Apr 30, 2018
huan added a commit that referenced this issue Apr 30, 2018
@huan huan added this to the v0.16 Connecting with the Cloud & App milestone Apr 30, 2018
@huan huan closed this as completed Apr 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants