From f0b1aa7edf9fe75ecf220e143f09e58e2df543ec Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 27 Sep 2018 20:04:22 +0900 Subject: [PATCH] Fix unnecessary messages retrieval --- osu.Game/Overlays/ChatOverlay.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 774570a747..98d8fb6322 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -449,13 +449,15 @@ private void fetchUpdates() fetchReq.Success += updates => { - // fuck the what. if (updates?.Presence != null) { foreach (var channel in updates.Presence) { - channel.Joined.Value = true; - addChannel(channel); + if (careChannels.Find(c => c.Id == channel.Id) == null) + { + channel.Joined.Value = true; + addChannel(channel); + } } foreach (var group in updates.Messages.Where(m => m.TargetType == TargetType.Channel).GroupBy(m => m.TargetId)) @@ -464,13 +466,11 @@ private void fetchUpdates() lastMessageId = updates.Messages.LastOrDefault()?.Id ?? lastMessageId; } - Debug.Write("success!"); fetchReq = null; }; fetchReq.Failure += delegate { - Debug.Write("failure!"); fetchReq = null; };