1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-22 07:52:56 +08:00

Fix joined channels not appearing as joined in the channel list

This commit is contained in:
Dean Herbert 2018-10-09 16:12:20 +09:00
parent 86f11777a7
commit a171ed3500

View File

@ -291,7 +291,7 @@ namespace osu.Game.Overlays
messageRequest?.Cancel(); messageRequest?.Cancel();
ListChannelsRequest req = new ListChannelsRequest(); ListChannelsRequest req = new ListChannelsRequest();
req.Success += delegate (List<Channel> channels) req.Success += delegate(List<Channel> channels)
{ {
AvailableChannels = channels; AvailableChannels = channels;
@ -323,10 +323,7 @@ namespace osu.Game.Overlays
protected Channel CurrentChannel protected Channel CurrentChannel
{ {
get get { return currentChannel; }
{
return currentChannel;
}
set set
{ {
@ -445,13 +442,7 @@ namespace osu.Game.Overlays
if (updates?.Presence != null) if (updates?.Presence != null)
{ {
foreach (var channel in updates.Presence) foreach (var channel in updates.Presence)
{ addChannel(AvailableChannels.Find(c => c.Id == channel.Id));
if (careChannels.Find(c => c.Id == channel.Id) == null)
{
channel.Joined.Value = true;
addChannel(channel);
}
}
foreach (var group in updates.Messages.GroupBy(m => m.ChannelId)) foreach (var group in updates.Messages.GroupBy(m => m.ChannelId))
careChannels.Find(c => c.Id == group.Key)?.AddNewMessages(group.ToArray()); careChannels.Find(c => c.Id == group.Key)?.AddNewMessages(group.ToArray());
@ -462,10 +453,7 @@ namespace osu.Game.Overlays
fetchReq = null; fetchReq = null;
}; };
fetchReq.Failure += delegate fetchReq.Failure += delegate { fetchReq = null; };
{
fetchReq = null;
};
api.Queue(fetchReq); api.Queue(fetchReq);
} }