1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00

use https for image urls

This commit is contained in:
takayama 2021-04-28 10:37:56 +09:00
parent fd31a4eb28
commit 69a30aa9d3
3 changed files with 7 additions and 7 deletions

View File

@ -195,13 +195,13 @@ func (c *QQClient) QueryFriendImage(target int64, hash []byte, size int32) (*mes
return &message.FriendImageElement{
ImageId: rsp.ResourceId,
Md5: hash,
Url: "http://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)
}
return &message.FriendImageElement{
ImageId: rsp.ResourceId,
Md5: hash,
Url: "http://c2cpicdw.qpic.cn/offpic_new/0/" + rsp.ResourceId + "/0?term=2",
Url: "https://c2cpicdw.qpic.cn/offpic_new/0/" + rsp.ResourceId + "/0?term=2",
}, nil
}

View File

@ -203,7 +203,7 @@ func NewGroupImage(id string, md5 []byte, fid int64, size, width, height, imageT
ImageType: imageType,
Width: width,
Height: height,
Url: "http://gchat.qpic.cn/gchatpic_new/1/0-0-" + strings.ReplaceAll(binary.CalculateImageResourceId(md5)[1:37], "-", "") + "/0?term=2",
Url: "https://gchat.qpic.cn/gchatpic_new/1/0-0-" + strings.ReplaceAll(binary.CalculateImageResourceId(md5)[1:37], "-", "") + "/0?term=2",
}
}

View File

@ -480,9 +480,9 @@ func ParseMessageElems(elems []*msg.Elem) []IMessageElement {
Height: elem.CustomFace.GetHeight(),
Url: func() string {
if elem.CustomFace.GetOrigUrl() == "" {
return "http://gchat.qpic.cn/gchatpic_new/0/0-0-" + strings.ReplaceAll(binary.CalculateImageResourceId(elem.CustomFace.Md5)[1:37], "-", "") + "/0?term=2"
return "https://gchat.qpic.cn/gchatpic_new/0/0-0-" + strings.ReplaceAll(binary.CalculateImageResourceId(elem.CustomFace.Md5)[1:37], "-", "") + "/0?term=2"
}
return "http://gchat.qpic.cn" + elem.CustomFace.GetOrigUrl()
return "https://gchat.qpic.cn" + elem.CustomFace.GetOrigUrl()
}(),
Md5: elem.CustomFace.Md5,
})
@ -490,9 +490,9 @@ func ParseMessageElems(elems []*msg.Elem) []IMessageElement {
if elem.NotOnlineImage != nil {
var img string
if elem.NotOnlineImage.GetOrigUrl() != "" {
img = "http://c2cpicdw.qpic.cn" + elem.NotOnlineImage.GetOrigUrl()
img = "https://c2cpicdw.qpic.cn" + elem.NotOnlineImage.GetOrigUrl()
} else {
img = "http://c2cpicdw.qpic.cn/offpic_new/0/" + elem.NotOnlineImage.GetResId() + "/0?term=2"
img = "https://c2cpicdw.qpic.cn/offpic_new/0/" + elem.NotOnlineImage.GetResId() + "/0?term=2"
}
res = append(res, &ImageElement{
Filename: elem.NotOnlineImage.GetFilePath(),