add .toObject() method to structures (#522)

* add .toObject() method to structures

* add compiled PMChannel change from last commit

* uncomment members in VoiceChannel toObject method
This commit is contained in:
Brian Tanner
2016-08-16 23:53:07 +07:00
committed by abal
parent e42178181d
commit fdfd41dd8c
21 changed files with 426 additions and 58 deletions

View File

@@ -31,6 +31,18 @@ var VoiceChannel = (function (_ServerChannel) {
this.bitrate = Math.round(this._bitrate / 1000); // store as kbps
}
VoiceChannel.prototype.toObject = function toObject() {
var obj = _ServerChannel.prototype.toObject.call(this);
obj.userLimit = this.userLimit;
obj.bitrate = this.bitrate;
obj.members = this.members.map(function (member) {
return member.toObject();
});
return obj;
};
VoiceChannel.prototype.join = function join() {
var callback = arguments.length <= 0 || arguments[0] === undefined ? function () {} : arguments[0];