mirror of
https://github.com/ppy/osu
synced 2025-01-05 13:50:03 +00:00
Refactors
This commit is contained in:
parent
396a5b3cd0
commit
c4769f6802
@ -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";
|
||||
}
|
||||
}
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user