diff --git a/client/image.go b/client/image.go index 394ffd21..d8646009 100644 --- a/client/image.go +++ b/client/image.go @@ -227,6 +227,7 @@ 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) } @@ -234,6 +235,9 @@ func (c *QQClient) QueryFriendImage(target int64, hash []byte, size int32) (*mes 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 } diff --git a/message/image.go b/message/image.go index 5d03744d..f4cd2d82 100644 --- a/message/image.go +++ b/message/image.go @@ -29,6 +29,8 @@ type FriendImageElement struct { ImageId string Md5 []byte Size int32 + Width int32 + Height int32 Url string Flash bool @@ -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), }