fix: move invite info to client

Since static methods do not have access to `this.client`, it was giving an error when trying to call these functions. The client itself is a better place for them.
This commit is contained in:
Pedro Lopez 2020-06-17 23:28:54 -04:00
commit b89f0e146f

View file

@ -478,6 +478,17 @@ class Client extends EventEmitter {
return ContactFactory.create(this, contact);
}
/**
* Returns an object with information about the invite code's group
* @param {string} inviteCode
* @returns {Promise<object>} Invite information
*/
async getInviteInfo(inviteCode) {
return await this.pupPage.evaluate(inviteCode => {
return window.Store.Wap.groupInviteInfo(inviteCode);
}, inviteCode);
}
/**
* Accepts an invitation to join a group
* @param {string} inviteCode Invitation code