From 529431f328cff6b0cb0ed8f7179e1ec538492dfa Mon Sep 17 00:00:00 2001 From: Linwenxuan <116782992+Linwenxuan05@users.noreply.github.com> Date: Sun, 29 Oct 2023 13:28:52 +0800 Subject: [PATCH] [Core] Push Ignored --- Lagrange.Core/Message/Entity/FileEntity.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Lagrange.Core/Message/Entity/FileEntity.cs b/Lagrange.Core/Message/Entity/FileEntity.cs index bfbec2414..6a2f6a441 100644 --- a/Lagrange.Core/Message/Entity/FileEntity.cs +++ b/Lagrange.Core/Message/Entity/FileEntity.cs @@ -24,6 +24,8 @@ public class FileEntity : IMessageEntity internal string? FileHash { get; set; } + internal Stream? FileStream { get; set; } + public FileEntity() { FileName = ""; @@ -38,6 +40,14 @@ public FileEntity(string path) FileName = Path.GetFileName(path); } + public FileEntity(byte[] payload, string fileName) + { + FileStream = new MemoryStream(payload); + FileMd5 = payload.Md5().UnHex(); + FileSize = payload.Length; + FileName = fileName; + } + internal FileEntity(long fileSize, string fileName, byte[] fileMd5, string fileUuid, string fileHash) { FileSize = fileSize;