Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

文件的Size使用long型解析, 增加SearchableContent赋值 #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CsChatClient/Messages/FileMessageContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace CsChatClient.Messages
public class FileMessageContent : MediaMessageContent
{
public string Name { get; set; }
public int Size { get; set; }
public long Size { get; set; }

public override void Decode(MessagePayload payload)
{
Expand All @@ -16,7 +16,7 @@ public override void Decode(MessagePayload payload)
{
Name = Name.Replace("[文件]", "");
}
Size = int.Parse(payload.Content);
Size = long.Parse(payload.Content);
}

public override string Digest(MessageEx message)
Expand All @@ -27,7 +27,7 @@ public override string Digest(MessageEx message)
public override MessagePayload Encode()
{
MessagePayload payload = base.Encode();
payload.SearchableContent = Name;
payload.SearchableContent = "[文件]" + Name;
payload.Content = Size + "";
payload.MediaType = MediaType.MediaTypeFile;
return payload;
Expand Down
1 change: 1 addition & 0 deletions CsChatClient/Messages/ImageMessageContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public override string Digest(MessageEx message)
public override MessagePayload Encode()
{
MessagePayload payload = base.Encode();
payload.SearchableContent = "[图片]";
payload.BinaryContent = ThumbnailBytes;
return payload;
}
Expand Down