Virtual channels should not be exposed to socket classes. Dont store guild in messages.

This commit is contained in:
RogueException
2016-11-18 14:14:11 -04:00
parent 3a5e4b23da
commit 53ee30c648
15 changed files with 151 additions and 135 deletions

View File

@@ -8,8 +8,8 @@ namespace Discord.WebSocket
{
internal static class SocketChannelHelper
{
public static IAsyncEnumerable<IReadOnlyCollection<IMessage>> GetMessagesAsync(SocketChannel channel, DiscordSocketClient discord, MessageCache messages,
ulong? fromMessageId, Direction dir, int limit, CacheMode mode, IGuild guild, RequestOptions options)
public static IAsyncEnumerable<IReadOnlyCollection<IMessage>> GetMessagesAsync(ISocketMessageChannel channel, DiscordSocketClient discord, MessageCache messages,
ulong? fromMessageId, Direction dir, int limit, CacheMode mode, RequestOptions options)
{
if (dir == Direction.Around)
throw new NotImplementedException(); //TODO: Impl
@@ -37,7 +37,7 @@ namespace Discord.WebSocket
//Download remaining messages
ulong? minId = cachedMessages.Count > 0 ? cachedMessages.Min(x => x.Id) : fromMessageId;
var downloadedMessages = ChannelHelper.GetMessagesAsync(channel, discord, minId, dir, limit, guild, options);
var downloadedMessages = ChannelHelper.GetMessagesAsync(channel, discord, minId, dir, limit, options);
return result.Concat(downloadedMessages);
}
else
@@ -46,7 +46,7 @@ namespace Discord.WebSocket
return result;
//Dont use cache in this case
return ChannelHelper.GetMessagesAsync(channel, discord, fromMessageId, dir, limit, guild, options);
return ChannelHelper.GetMessagesAsync(channel, discord, fromMessageId, dir, limit, options);
}
}
public static IReadOnlyCollection<SocketMessage> GetCachedMessages(SocketChannel channel, DiscordSocketClient discord, MessageCache messages,