Skip to content

Commit

Permalink
[Core] Push Ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
Linwenxuan authored and Linwenxuan committed Oct 29, 2023
1 parent 5dac7a5 commit 529431f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Lagrange.Core/Message/Entity/FileEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class FileEntity : IMessageEntity

internal string? FileHash { get; set; }

internal Stream? FileStream { get; set; }

public FileEntity()
{
FileName = "";
Expand All @@ -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;
Expand Down

0 comments on commit 529431f

Please sign in to comment.