31 lines
898 B
C#
31 lines
898 B
C#
|
using SharpChat.Users;
|
|||
|
using SharpChat.Users.Remote;
|
|||
|
using System.Text.Json.Serialization;
|
|||
|
|
|||
|
namespace SharpChat.DataProvider.Misuzu.Users {
|
|||
|
public class MisuzuUser : IRemoteUser {
|
|||
|
[JsonPropertyName(@"user_id")]
|
|||
|
public long UserId { get; set; }
|
|||
|
|
|||
|
[JsonPropertyName(@"username")]
|
|||
|
public string UserName { get; set; }
|
|||
|
|
|||
|
[JsonPropertyName(@"colour_raw")]
|
|||
|
public int ColourRaw { get; set; }
|
|||
|
|
|||
|
[JsonIgnore]
|
|||
|
public Colour Colour => new(ColourRaw);
|
|||
|
|
|||
|
[JsonPropertyName(@"rank")]
|
|||
|
public int Rank { get; set; }
|
|||
|
|
|||
|
[JsonPropertyName(@"perms")]
|
|||
|
public UserPermissions Permissions { get; set; }
|
|||
|
|
|||
|
public bool Equals(IUser other)
|
|||
|
=> other is MisuzuUser && other.UserId == UserId;
|
|||
|
public bool Equals(IRemoteUser other)
|
|||
|
=> other is MisuzuUser && other.UserId == UserId;
|
|||
|
}
|
|||
|
}
|