fixed how channels and users are cached

This commit is contained in:
hydrabolt
2015-08-24 17:30:20 +01:00
parent ff0187a4b1
commit 97a6ff2772
6 changed files with 197 additions and 143 deletions

View File

@@ -5,8 +5,8 @@ class Server {
this.ownerID = data.owner_id;
this.name = data.name;
this.id = data.id;
this.members = new Set();
this.channels = new Set();
this.members = [];
this.channels = [];
this.icon = data.icon;
this.afkTimeout = data.afk_timeout;
this.afkChannelId = data.afk_channel_id;
@@ -18,13 +18,9 @@ class Server {
// get a user from this server's member list,
// it will be identical (unless an async change occurred)
// to the client's cache.
this.members.add(client.addUser(member.user));
this.members.push(client.addUser(member.user));
}
for (var channel of data.channels) {
this.channels.add(client.addChannel(channel, this.id));
}
}
get iconURL() {