Skip to content

Commit

Permalink
fix private image size
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrs4s committed Jun 10, 2023
1 parent 758c7b8 commit 7c68459
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,17 @@ func (c *QQClient) QueryFriendImage(target int64, hash []byte, size int32) (*mes
return &message.FriendImageElement{
ImageId: rsp.ResourceId,
Md5: hash,
Size: size,
Url: "https://c2cpicdw.qpic.cn/offpic_new/0/" + rsp.ResourceId + "/0?term=2",
}, errors.WithStack(ErrNotExists)
}
return &message.FriendImageElement{
ImageId: rsp.ResourceId,
Md5: hash,
Url: "https://c2cpicdw.qpic.cn/offpic_new/0/" + rsp.ResourceId + "/0?term=2",
Size: size,
Height: rsp.Height,
Width: rsp.Width,
}, nil
}

Expand Down
4 changes: 4 additions & 0 deletions message/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ type FriendImageElement struct {
ImageId string
Md5 []byte
Size int32
Width int32
Height int32
Url string

Flash bool
Expand Down Expand Up @@ -151,6 +153,8 @@ func (e *FriendImageElement) Pack() []*msg.Elem {
ResId: proto.Some(e.ImageId),
OldPicMd5: proto.Some(false),
PicMd5: e.Md5,
PicHeight: proto.Some(e.Height),
PicWidth: proto.Some(e.Width),
DownloadPath: proto.Some(e.ImageId),
Original: proto.Int32(1),
}
Expand Down

0 comments on commit 7c68459

Please sign in to comment.