diff --git a/src/Discord.Net/DiscordClient.Messages.cs b/src/Discord.Net/DiscordClient.Messages.cs index 984c69594..4dd7e4713 100644 --- a/src/Discord.Net/DiscordClient.Messages.cs +++ b/src/Discord.Net/DiscordClient.Messages.cs @@ -223,6 +223,8 @@ namespace Discord if (count < 0) throw new ArgumentNullException(nameof(count)); CheckReady(); + bool trackActivity = Config.TrackActivity; + if (count == 0) return new Message[0]; if (channel != null && channel.Type == ChannelType.Text) { @@ -233,21 +235,20 @@ namespace Discord { Message msg = null; if (cache) - msg = _messages.GetOrAdd(x.Id, x.ChannelId, x.Author.Id); - else - { - msg = _messages[x.Id] ?? new Message(this, x.Id, x.ChannelId, x.Author.Id); - msg.Update(x); //TODO: Look into updating when cache is true, but only if we actually generated a new message. - } - if (Config.TrackActivity) { - if (!channel.IsPrivate) + msg = _messages.GetOrAdd(x.Id, x.ChannelId, x.Author.Id); + if (trackActivity) { var user = msg.User; if (user != null) user.UpdateActivity(msg.EditedTimestamp ?? msg.Timestamp); } } + else + { + msg = /*_messages[x.Id] ??*/ new Message(this, x.Id, x.ChannelId, x.Author.Id); + msg.Update(x); + } return msg; }) .ToArray();