29 lines
927 B
C#
29 lines
927 B
C#
|
using SharpChat.Users;
|
|||
|
using System;
|
|||
|
|
|||
|
namespace SharpChat.Events {
|
|||
|
[Event(TYPE)]
|
|||
|
public class UserConnectEvent : Event {
|
|||
|
public const string TYPE = @"user:connect";
|
|||
|
|
|||
|
public string Name { get; }
|
|||
|
public Colour Colour { get; }
|
|||
|
public int Rank { get; }
|
|||
|
public UserPermissions Permissions { get; }
|
|||
|
public string NickName { get; }
|
|||
|
public UserStatus Status { get; }
|
|||
|
public string StatusMessage { get; }
|
|||
|
|
|||
|
public UserConnectEvent(ILocalUser user)
|
|||
|
: base(user ?? throw new ArgumentNullException(nameof(user))) {
|
|||
|
Name = user.UserName;
|
|||
|
Colour = user.Colour;
|
|||
|
Rank = user.Rank;
|
|||
|
Permissions = user.Permissions;
|
|||
|
NickName = string.IsNullOrWhiteSpace(user.NickName) ? null : user.NickName;
|
|||
|
Status = user.Status;
|
|||
|
StatusMessage = user.StatusMessage;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|