1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 04:02:59 +08:00

Merge remote-tracking branch 'origin/update-chat-api' into update-framework

This commit is contained in:
Dean Herbert 2018-09-28 18:23:09 +09:00
commit e1c187b641
2 changed files with 9 additions and 5 deletions

View File

@ -60,6 +60,8 @@ namespace osu.Game.Online.Chat
{
messages = messages.Except(Messages).ToArray();
if (messages.Length == 0) return;
Messages.AddRange(messages);
MessagesLoaded = true;

View File

@ -304,6 +304,8 @@ namespace osu.Game.Overlays
Scheduler.Add(delegate
{
//todo: decide how to handle default channels for a user now that they are saved server-side.
// we likely don't want to re-join every startup like this.
//addChannel(channels.Find(c => c.Name == @"#lazer"));
//addChannel(channels.Find(c => c.Name == @"#osu"));
//addChannel(channels.Find(c => c.Name == @"#lobby"));
@ -449,13 +451,15 @@ namespace osu.Game.Overlays
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 +468,11 @@ namespace osu.Game.Overlays
lastMessageId = updates.Messages.LastOrDefault()?.Id ?? lastMessageId;
}
Debug.Write("success!");
fetchReq = null;
};
fetchReq.Failure += delegate
{
Debug.Write("failure!");
fetchReq = null;
};