Made it better! Much better caching

This commit is contained in:
hydrabolt
2015-08-11 16:55:32 +01:00
parent 4edaba5a1f
commit 6887e0d6bc
6 changed files with 214 additions and 31 deletions

View File

@@ -1,7 +1,16 @@
exports.Channel = function(name, serverId, type, id, isPrivate){
exports.Channel = function(name, server, type, id, isPrivate){
if(!type){ //there's no second argument
var channel = name;
name = channel.name;
server = server;
type = channel.type;
id = channel.id;
isPrivate = channel.is_private;
}
this.name = name;
this.serverId = serverId;
this.server = server;
this.type = type;
this.id = id;
this.isPrivate = isPrivate;
@@ -9,11 +18,9 @@ exports.Channel = function(name, serverId, type, id, isPrivate){
}
exports.Channel.equals = function(otherChannel){
if(otherChannel.id === this.id){
return true;
} else {
return false;
}
}