mirror of
https://github.com/ppy/osu
synced 2024-12-17 20:35:21 +00:00
add AddFriendResponse
This commit is contained in:
parent
1fcdf67806
commit
c576fd8448
@ -443,7 +443,10 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
requestLock.Wait(3000);
|
||||
dummyAPI.Friends.Add(apiRelation);
|
||||
req.TriggerSuccess(apiRelation);
|
||||
req.TriggerSuccess(new AddFriendResponse
|
||||
{
|
||||
UserRelation = apiRelation
|
||||
});
|
||||
});
|
||||
|
||||
return true;
|
||||
@ -483,7 +486,10 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
requestLock.Wait(3000);
|
||||
dummyAPI.Friends.Add(apiRelation);
|
||||
req.TriggerSuccess(apiRelation);
|
||||
req.TriggerSuccess(new AddFriendResponse
|
||||
{
|
||||
UserRelation = apiRelation
|
||||
});
|
||||
});
|
||||
|
||||
return true;
|
||||
|
@ -3,11 +3,10 @@
|
||||
|
||||
using System.Net.Http;
|
||||
using osu.Framework.IO.Network;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
public class AddFriendRequest : APIRequest<APIRelation>
|
||||
public class AddFriendRequest : APIRequest<AddFriendResponse>
|
||||
{
|
||||
public readonly int TargetId;
|
||||
|
||||
|
14
osu.Game/Online/API/Requests/AddFriendResponse.cs
Normal file
14
osu.Game/Online/API/Requests/AddFriendResponse.cs
Normal file
@ -0,0 +1,14 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
public class AddFriendResponse
|
||||
{
|
||||
[JsonProperty("user_relation")]
|
||||
public APIRelation UserRelation = null!;
|
||||
}
|
||||
}
|
@ -98,7 +98,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
||||
if (req is AddFriendRequest addedRequest)
|
||||
{
|
||||
SetValue(++followerCount);
|
||||
status.Value = addedRequest.Response?.Mutual == true ? FriendStatus.Mutual : FriendStatus.NotMutual;
|
||||
status.Value = addedRequest.Response?.UserRelation.Mutual == true ? FriendStatus.Mutual : FriendStatus.NotMutual;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user