mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Merge branch 'master' into pinned-comment
This commit is contained in:
@ -305,9 +305,11 @@ namespace osu.Game.Online.API
|
||||
{
|
||||
req.Perform(this);
|
||||
|
||||
if (req.CompletionState != APIRequestCompletionState.Completed)
|
||||
return false;
|
||||
|
||||
// we could still be in initialisation, at which point we don't want to say we're Online yet.
|
||||
if (IsLoggedIn) state.Value = APIState.Online;
|
||||
|
||||
failureCount = 0;
|
||||
return true;
|
||||
}
|
||||
@ -381,7 +383,7 @@ namespace osu.Game.Online.API
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsLoggedIn => localUser.Value.Id > 1;
|
||||
public bool IsLoggedIn => localUser.Value.Id > 1; // TODO: should this also be true if attempting to connect?
|
||||
|
||||
public void Queue(APIRequest request)
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ namespace osu.Game.Online.API
|
||||
/// The state of this request, from an outside perspective.
|
||||
/// This is used to ensure correct notification events are fired.
|
||||
/// </summary>
|
||||
private APIRequestCompletionState completionState;
|
||||
public APIRequestCompletionState CompletionState { get; private set; }
|
||||
|
||||
public void Perform(IAPIProvider api)
|
||||
{
|
||||
@ -127,10 +127,10 @@ namespace osu.Game.Online.API
|
||||
{
|
||||
lock (completionStateLock)
|
||||
{
|
||||
if (completionState != APIRequestCompletionState.Waiting)
|
||||
if (CompletionState != APIRequestCompletionState.Waiting)
|
||||
return;
|
||||
|
||||
completionState = APIRequestCompletionState.Completed;
|
||||
CompletionState = APIRequestCompletionState.Completed;
|
||||
}
|
||||
|
||||
if (API == null)
|
||||
@ -143,10 +143,10 @@ namespace osu.Game.Online.API
|
||||
{
|
||||
lock (completionStateLock)
|
||||
{
|
||||
if (completionState != APIRequestCompletionState.Waiting)
|
||||
if (CompletionState != APIRequestCompletionState.Waiting)
|
||||
return;
|
||||
|
||||
completionState = APIRequestCompletionState.Failed;
|
||||
CompletionState = APIRequestCompletionState.Failed;
|
||||
}
|
||||
|
||||
if (API == null)
|
||||
@ -161,7 +161,7 @@ namespace osu.Game.Online.API
|
||||
{
|
||||
lock (completionStateLock)
|
||||
{
|
||||
if (completionState != APIRequestCompletionState.Waiting)
|
||||
if (CompletionState != APIRequestCompletionState.Waiting)
|
||||
return;
|
||||
|
||||
WebRequest?.Abort();
|
||||
@ -200,7 +200,7 @@ namespace osu.Game.Online.API
|
||||
get
|
||||
{
|
||||
lock (completionStateLock)
|
||||
return completionState == APIRequestCompletionState.Failed;
|
||||
return CompletionState == APIRequestCompletionState.Failed;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,16 +9,16 @@ namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
public class MarkChannelAsReadRequest : APIRequest
|
||||
{
|
||||
private readonly Channel channel;
|
||||
private readonly Message message;
|
||||
public readonly Channel Channel;
|
||||
public readonly Message Message;
|
||||
|
||||
public MarkChannelAsReadRequest(Channel channel, Message message)
|
||||
{
|
||||
this.channel = channel;
|
||||
this.message = message;
|
||||
Channel = channel;
|
||||
Message = message;
|
||||
}
|
||||
|
||||
protected override string Target => $"chat/channels/{channel.Id}/mark-as-read/{message.Id}";
|
||||
protected override string Target => $"chat/channels/{Channel.Id}/mark-as-read/{Message.Id}";
|
||||
|
||||
protected override WebRequest CreateWebRequest()
|
||||
{
|
||||
|
Reference in New Issue
Block a user