Refactors

This commit is contained in:
Dean Herbert 2018-11-14 13:19:20 +09:00
parent 396a5b3cd0
commit c4769f6802
2 changed files with 3 additions and 25 deletions

View File

@ -1,17 +0,0 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Online.API.Requests
{
public class GetPrivateMessagesRequest : APIMessagesRequest
{
private long? since;
public GetPrivateMessagesRequest(long? sinceId = null)
: base(sinceId)
{
}
protected override string Target => @"chat/messages/private";
}
}

View File

@ -66,8 +66,7 @@ namespace osu.Game.Online.Chat
if (name == null)
throw new ArgumentNullException(nameof(name));
CurrentChannel.Value = AvailableChannels.FirstOrDefault(c => c.Name == name)
?? throw new ChannelNotFoundException(name);
CurrentChannel.Value = AvailableChannels.FirstOrDefault(c => c.Name == name) ?? throw new ChannelNotFoundException(name);
}
/// <summary>
@ -83,11 +82,7 @@ namespace osu.Game.Online.Chat
?? new Channel { Name = user.Username, Users = { user } };
}
private void currentChannelChanged(Channel channel)
{
JoinChannel(channel);
}
private void currentChannelChanged(Channel channel) => JoinChannel(channel);
/// <summary>
/// Ensure we run post actions in sequence, once at a time.
@ -258,7 +253,7 @@ namespace osu.Game.Online.Chat
fetchInitialMsgReq.Success += messages =>
{
handleChannelMessages(messages);
channel.MessagesLoaded = true; // this will mark the channel as having received messages even if tehre were none.
channel.MessagesLoaded = true; // this will mark the channel as having received messages even if there were none.
};
api.Queue(fetchInitialMsgReq);