Invites

Users can be invited to channels. Once invited, the user can accept or reject the invites.

To get a all the invites for a user you can use currentUser.getInvites function.

var invite;
voicelayer.invites.getAll(function(err, data) {
  invite = data[0];
});

To accept an invite the invites.accept function is used.

voicelayer.invites.accept(invite function(err, data) {
  //
});

After accepting an invite, the user will automatically join the channel and start receiving real-time events for the channel.

To reject an invite the invites.reject function is used.

voicelayer.invites.reject(invite function(err, data) {
  //
});