Fixed start PM

This commit is contained in:
hydrabolt
2015-10-31 23:46:46 +00:00
parent 6d6dcf533a
commit 3c16a9f2a4
8 changed files with 35 additions and 71 deletions

View File

@@ -7,7 +7,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Channel = require("./Channel.js");
var User = require("./User.js");
var Equality = require("../Util/Equality.js");
var Cache = require("../Util/Cache.js");
var PMChannel = (function (_Equality) {
_inherits(PMChannel, _Equality);
@@ -21,7 +23,8 @@ var PMChannel = (function (_Equality) {
this.type = data.type || "text";
this.id = data.id;
this.lastMessageId = data.last_message_id;
this.recipient = this.client.internal.users.add(data.recipient);
this.messages = new Cache("id", 1000);
this.recipient = this.client.internal.users.add(new User(data.recipient, this.client));
}
/* warning! may return null */