Only a single clear mode is ever used, removed the rest.

This commit is contained in:
flash 2024-05-28 21:51:54 +00:00
parent 86effa0452
commit 6bda1ee09d
3 changed files with 8 additions and 22 deletions

View file

@ -0,0 +1,7 @@
namespace SharpChat.SockChat.PacketsS2C {
public class ClearMessagesAndUsersS2CPacket : ISockChatS2CPacket {
public string Pack() {
return "8\t3";
}
}
}

View file

@ -1,21 +0,0 @@
namespace SharpChat.SockChat.PacketsS2C {
public class ContextClearS2CPacket : ISockChatS2CPacket {
public enum ClearMode {
Messages = 0,
Users = 1,
Channels = 2,
MessagesUsers = 3,
MessagesUsersChannels = 4,
}
private readonly ClearMode Mode;
public ContextClearS2CPacket(ClearMode mode) {
Mode = mode;
}
public string Pack() {
return string.Format("8\t{0}", (int)Mode);
}
}
}

View file

@ -445,7 +445,7 @@ namespace SharpChat {
Events.Dispatch("chan:join", now, chan, user);
SendTo(user, new ContextClearS2CPacket(ContextClearS2CPacket.ClearMode.MessagesUsers));
SendTo(user, new ClearMessagesAndUsersS2CPacket());
SendTo(user, new UsersPopulateS2CPacket(GetChannelUsers(chan).Except(new[] { user }).Select(
user => new UsersPopulateS2CPacket.ListEntry(
user.UserId,