2022-08-30 15:00:58 +00:00
|
|
|
|
using SharpChat.Packet;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
|
|
|
|
|
namespace SharpChat.Events {
|
|
|
|
|
public class UserDisconnectEvent : IChatEvent {
|
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public DateTimeOffset DateTime { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
2023-02-17 21:47:44 +00:00
|
|
|
|
public ChatUser Sender { get; set; }
|
2022-08-30 15:00:58 +00:00
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
2023-02-16 22:47:30 +00:00
|
|
|
|
public string ChannelName { get; set; }
|
2022-08-30 15:00:58 +00:00
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public ChatMessageFlags Flags { get; set; } = ChatMessageFlags.Log;
|
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public long SequenceId { get; set; }
|
|
|
|
|
|
2023-02-08 03:17:07 +00:00
|
|
|
|
[JsonPropertyName("reason")]
|
2022-08-30 15:00:58 +00:00
|
|
|
|
public UserDisconnectReason Reason { get; set; }
|
|
|
|
|
|
|
|
|
|
public UserDisconnectEvent() { }
|
2023-02-17 21:47:44 +00:00
|
|
|
|
public UserDisconnectEvent(DateTimeOffset parted, ChatUser user, ChatChannel channel, UserDisconnectReason reason) {
|
2022-08-30 15:00:58 +00:00
|
|
|
|
DateTime = parted;
|
|
|
|
|
Sender = user;
|
2023-02-16 22:47:30 +00:00
|
|
|
|
ChannelName = channel.Name;
|
2022-08-30 15:00:58 +00:00
|
|
|
|
Reason = reason;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|