sharp-chat/SharpChat.Protocol.SockChat/Packets/TypingPacket.cs

30 lines
982 B
C#
Raw Permalink Normal View History

2022-08-30 15:05:29 +00:00
using SharpChat.Channels;
using System;
using System.Text;
namespace SharpChat.Protocol.SockChat.Packets {
public class TypingPacket : ServerPacket {
public IChannel Channel { get; }
public object TypingInfo { get; }
public TypingPacket(IChannel channel, object typingInfo) {
Channel = channel ?? throw new ArgumentNullException(nameof(channel));
TypingInfo = typingInfo ?? throw new ArgumentNullException(nameof(typingInfo));
}
protected override string DoPack() {
StringBuilder sb = new();
sb.Append((int)ServerPacketId.TypingInfo);
sb.Append(IServerPacket.SEPARATOR);
sb.Append(Channel.Name);
sb.Append(IServerPacket.SEPARATOR);
//sb.Append(TypingInfo.User.UserId);
sb.Append(IServerPacket.SEPARATOR);
//sb.Append(TypingInfo.Started.ToUnixTimeSeconds());
return sb.ToString();
}
}
}