sharp-chat/SharpChat.Protocol.SockChat/PacketHandlers/TypingPacketHandler.cs

30 lines
1 KiB
C#
Raw Permalink Normal View History

2022-08-30 15:05:29 +00:00
namespace SharpChat.Protocol.SockChat.PacketHandlers {
public class TypingPacketHandler : IPacketHandler {
public ClientPacketId PacketId => ClientPacketId.Typing;
public void HandlePacket(PacketHandlerContext ctx) {
/*if(!ctx.HasUser)
return;
if(!long.TryParse(ctx.Args.ElementAtOrDefault(1), out long userId) || ctx.User.UserId != userId)
return;
string channelName = ctx.Args.ElementAtOrDefault(2)?.ToLowerInvariant();
if(!string.IsNullOrWhiteSpace(channelName))
return;
IChannel channel = ctx.User.GetChannels().FirstOrDefault(c => c.Name.ToLowerInvariant() == channelName);
if(channel == null || !channel.CanType(ctx.User))
return;
ctx.Session.LastChannel = channel;
ChannelTyping info = channel.RegisterTyping(ctx.User);
if(info == null)
return;
channel.SendPacket(new TypingPacket(channel, info));*/
}
}
}