Removed unused method from ChatMessageAddPacket.

This commit is contained in:
flash 2024-05-10 15:25:34 +00:00
parent 0b0de00cc4
commit 1ba94a526c

View file

@ -1,5 +1,4 @@
using SharpChat.EventStorage; using System;
using System;
using System.Text; using System.Text;
namespace SharpChat.Packet { namespace SharpChat.Packet {
@ -25,22 +24,6 @@ namespace SharpChat.Packet {
IsPrivate = isPrivate; IsPrivate = isPrivate;
} }
public static ChatMessageAddPacket FromStoredEvent(StoredEventInfo sei) {
if(sei == null)
throw new ArgumentNullException(nameof(sei));
if(sei.Type is not "msg:add" and not "SharpChat.Events.ChatMessage")
throw new ArgumentException("Wrong event type.", nameof(sei));
return new ChatMessageAddPacket(
sei.Id,
sei.Created,
sei.Sender?.UserId ?? -1,
string.Empty, // todo: this
(sei.Flags & StoredEventFlags.Action) > 0,
(sei.Flags & StoredEventFlags.Private) > 0
);
}
public override string Pack() { public override string Pack() {
StringBuilder sb = new(); StringBuilder sb = new();