1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 19:17:38 +08:00

fix private image size

This commit is contained in:
Mrs4s 2023-06-10 16:15:57 +08:00
parent 758c7b8efa
commit 7c68459666
No known key found for this signature in database
GPG Key ID: 3186E98FA19CE3A7
2 changed files with 8 additions and 0 deletions

View File

@ -227,6 +227,7 @@ func (c *QQClient) QueryFriendImage(target int64, hash []byte, size int32) (*mes
return &message.FriendImageElement{ return &message.FriendImageElement{
ImageId: rsp.ResourceId, ImageId: rsp.ResourceId,
Md5: hash, Md5: hash,
Size: size,
Url: "https://c2cpicdw.qpic.cn/offpic_new/0/" + rsp.ResourceId + "/0?term=2", Url: "https://c2cpicdw.qpic.cn/offpic_new/0/" + rsp.ResourceId + "/0?term=2",
}, errors.WithStack(ErrNotExists) }, errors.WithStack(ErrNotExists)
} }
@ -234,6 +235,9 @@ func (c *QQClient) QueryFriendImage(target int64, hash []byte, size int32) (*mes
ImageId: rsp.ResourceId, ImageId: rsp.ResourceId,
Md5: hash, Md5: hash,
Url: "https://c2cpicdw.qpic.cn/offpic_new/0/" + rsp.ResourceId + "/0?term=2", Url: "https://c2cpicdw.qpic.cn/offpic_new/0/" + rsp.ResourceId + "/0?term=2",
Size: size,
Height: rsp.Height,
Width: rsp.Width,
}, nil }, nil
} }

View File

@ -29,6 +29,8 @@ type FriendImageElement struct {
ImageId string ImageId string
Md5 []byte Md5 []byte
Size int32 Size int32
Width int32
Height int32
Url string Url string
Flash bool Flash bool
@ -151,6 +153,8 @@ func (e *FriendImageElement) Pack() []*msg.Elem {
ResId: proto.Some(e.ImageId), ResId: proto.Some(e.ImageId),
OldPicMd5: proto.Some(false), OldPicMd5: proto.Some(false),
PicMd5: e.Md5, PicMd5: e.Md5,
PicHeight: proto.Some(e.Height),
PicWidth: proto.Some(e.Width),
DownloadPath: proto.Some(e.ImageId), DownloadPath: proto.Some(e.ImageId),
Original: proto.Int32(1), Original: proto.Int32(1),
} }