Skip to content

Commit

Permalink
[Core] Fixed md5 of Operation
Browse files Browse the repository at this point in the history
  • Loading branch information
Linwenxuan04 committed Oct 3, 2024
1 parent 12ef2a6 commit f110e17
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,8 @@ public async Task<bool> SetAvatar(ImageEntity avatar)
if (highwayUrlResults.Count == 0) return false;

var ticket = ((HighwayUrlEvent)highwayUrlResults[0]).SigSession;
return await Collection.Highway.UploadSrcByStreamAsync(90, avatar.ImageStream.Value, ticket, avatar.ImageMd5, Array.Empty<byte>());
var md5 = avatar.ImageStream.Value.Md5().UnHex();
return await Collection.Highway.UploadSrcByStreamAsync(90, avatar.ImageStream.Value, ticket, md5, Array.Empty<byte>());
}

public async Task<bool> GroupSetAvatar(uint groupUin, ImageEntity avatar)
Expand All @@ -604,6 +605,7 @@ public async Task<bool> GroupSetAvatar(uint groupUin, ImageEntity avatar)
if (highwayUrlResults.Count == 0) return false;

var ticket = ((HighwayUrlEvent)highwayUrlResults[0]).SigSession;
var md5 = avatar.ImageStream.Value.Md5().UnHex();
var extra = new GroupAvatarExtra
{
Type = 101,
Expand All @@ -612,6 +614,6 @@ public async Task<bool> GroupSetAvatar(uint groupUin, ImageEntity avatar)
Field5 = 3,
Field6 = 1
}.Serialize().ToArray();
return await Collection.Highway.UploadSrcByStreamAsync(3000, avatar.ImageStream.Value, ticket, avatar.ImageMd5, extra);
return await Collection.Highway.UploadSrcByStreamAsync(3000, avatar.ImageStream.Value, ticket, md5, extra);
}
}

0 comments on commit f110e17

Please sign in to comment.