From a944b1576a4fd8151f5986d6e6cd70c7699d6758 Mon Sep 17 00:00:00 2001 From: RogueException Date: Tue, 7 Jun 2016 21:37:11 -0300 Subject: [PATCH] Fixed a few datastore issues --- src/Discord.Net/Entities/WebSocket/CachedGuild.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Discord.Net/Entities/WebSocket/CachedGuild.cs b/src/Discord.Net/Entities/WebSocket/CachedGuild.cs index 2c5f02f33..f2b032331 100644 --- a/src/Discord.Net/Entities/WebSocket/CachedGuild.cs +++ b/src/Discord.Net/Entities/WebSocket/CachedGuild.cs @@ -62,7 +62,7 @@ namespace Discord if (model.Channels != null) { for (int i = 0; i < model.Channels.Length; i++) - AddCachedChannel(model.Channels[i], channels, dataStore); + AddCachedChannel(model.Channels[i], channels); } _channels = channels; @@ -85,10 +85,9 @@ namespace Discord public override Task GetChannel(ulong id) => Task.FromResult(GetCachedChannel(id)); public override Task> GetChannels() => Task.FromResult>(Channels); - public ICachedGuildChannel AddCachedChannel(ChannelModel model, ConcurrentHashSet channels = null, DataStore dataStore = null) + public ICachedGuildChannel AddCachedChannel(ChannelModel model, ConcurrentHashSet channels = null) { var channel = ToChannel(model); - (dataStore ?? Discord.DataStore).AddChannel(channel); (channels ?? _channels).TryAdd(model.Id); return channel; } @@ -96,10 +95,9 @@ namespace Discord { return Discord.DataStore.GetChannel(id) as ICachedGuildChannel; } - public ICachedGuildChannel RemoveCachedChannel(ulong id, ConcurrentHashSet channels = null, DataStore dataStore = null) + public void RemoveCachedChannel(ulong id, ConcurrentHashSet channels = null) { (channels ?? _channels).TryRemove(id); - return (dataStore ?? Discord.DataStore).RemoveChannel(id) as ICachedGuildChannel; } public Presence AddCachedPresence(PresenceModel model, ConcurrentDictionary presences = null)