mirror of
https://github.com/ppy/osu
synced 2024-12-17 12:25:19 +00:00
Reverted GetUserRequest because spectating is not implemented yet, and thus the additions are not needed (yet)
This commit is contained in:
parent
772bba27be
commit
ce9b003e9a
@ -8,7 +8,6 @@ namespace osu.Game.Online.API.Requests
|
|||||||
public class GetUserRequest : APIRequest<User>
|
public class GetUserRequest : APIRequest<User>
|
||||||
{
|
{
|
||||||
private long? userId;
|
private long? userId;
|
||||||
private string userName;
|
|
||||||
|
|
||||||
/// <param name="userId">The user's ID.</param>
|
/// <param name="userId">The user's ID.</param>
|
||||||
public GetUserRequest(long? userId = null)
|
public GetUserRequest(long? userId = null)
|
||||||
@ -16,13 +15,7 @@ namespace osu.Game.Online.API.Requests
|
|||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <param name="userName">The user's username.</param>
|
|
||||||
public GetUserRequest(string userName)
|
|
||||||
{
|
|
||||||
this.userName = userName;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prefer ID over name
|
// Prefer ID over name
|
||||||
protected override string Target => userId.HasValue ? $@"users/{userId}" : ((!string.IsNullOrEmpty(userName)) ? $@"users/{userName}" : @"me");
|
protected override string Target => userId.HasValue ? $@"users/{userId}" : @"me";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,8 +81,7 @@ namespace osu.Game.Online.Chat
|
|||||||
if (int.TryParse(args[1], out int userId))
|
if (int.TryParse(args[1], out int userId))
|
||||||
req = new GetUserRequest(userId);
|
req = new GetUserRequest(userId);
|
||||||
else
|
else
|
||||||
// Get by username instead
|
return;
|
||||||
req = new GetUserRequest(args[1]);
|
|
||||||
|
|
||||||
req.Success += user =>
|
req.Success += user =>
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user