Reverted GetUserRequest because spectating is not implemented yet, and thus the additions are not needed (yet)

This commit is contained in:
FreezyLemon 2017-12-07 16:52:43 +01:00
parent 772bba27be
commit ce9b003e9a
2 changed files with 2 additions and 10 deletions

View File

@ -8,7 +8,6 @@ namespace osu.Game.Online.API.Requests
public class GetUserRequest : APIRequest<User>
{
private long? userId;
private string userName;
/// <param name="userId">The user's ID.</param>
public GetUserRequest(long? userId = null)
@ -16,13 +15,7 @@ namespace osu.Game.Online.API.Requests
this.userId = userId;
}
/// <param name="userName">The user's username.</param>
public GetUserRequest(string userName)
{
this.userName = userName;
}
// 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";
}
}

View File

@ -81,8 +81,7 @@ namespace osu.Game.Online.Chat
if (int.TryParse(args[1], out int userId))
req = new GetUserRequest(userId);
else
// Get by username instead
req = new GetUserRequest(args[1]);
return;
req.Success += user =>
{