mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-07-08 23:28:31 +00:00
Compare commits
1 Commits
master
...
f4a63a83cd
Author | SHA1 | Date | |
---|---|---|---|
f4a63a83cd |
@ -672,32 +672,36 @@ func ParseMessageElems(elems []*msg.Elem) []IMessageElement {
|
|||||||
}
|
}
|
||||||
return []IMessageElement{sticker} // sticker 永远为单独消息
|
return []IMessageElement{sticker} // sticker 永远为单独消息
|
||||||
case 48:
|
case 48:
|
||||||
img := &msg.PbMultiMediaElement{}
|
bt := elem.CommonElem.BusinessType.Unwrap()
|
||||||
_ = proto.Unmarshal(elem.CommonElem.PbElem, img)
|
// 20 for group, 10 for friend, 22 or 12 for voice record
|
||||||
domain := img.Elem1.Data.Domain.Unwrap()
|
if bt == 20 || bt == 10 {
|
||||||
imgURL := img.Elem1.Data.ImgURL.Unwrap()
|
img := &msg.PbMultiMediaElement{}
|
||||||
|
_ = proto.Unmarshal(elem.CommonElem.PbElem, img)
|
||||||
|
domain := img.Elem1.Data.Domain.Unwrap()
|
||||||
|
imgURL := img.Elem1.Data.ImgURL.Unwrap()
|
||||||
|
|
||||||
if img.Elem2.Data.Friend != nil {
|
if img.Elem2.Data.Friend != nil {
|
||||||
rKey := img.Elem2.Data.Friend.RKey.Unwrap()
|
rKey := img.Elem2.Data.Friend.RKey.Unwrap()
|
||||||
url := fmt.Sprintf("https://%s%s%s&spec=0&rf=naio", domain, imgURL, rKey)
|
url := fmt.Sprintf("https://%s%s%s&spec=0&rf=naio", domain, imgURL, rKey)
|
||||||
res = append(res, &FriendImageElement{
|
res = append(res, &FriendImageElement{
|
||||||
ImageId: img.Elem1.Meta.FilePath.Unwrap(),
|
ImageId: img.Elem1.Meta.FilePath.Unwrap(),
|
||||||
Size: img.Elem1.Meta.Data.FileLen.Unwrap(),
|
Size: img.Elem1.Meta.Data.FileLen.Unwrap(),
|
||||||
Url: url,
|
Url: url,
|
||||||
Md5: img.Elem1.Meta.Data.PicMd5,
|
Md5: img.Elem1.Meta.Data.PicMd5,
|
||||||
})
|
})
|
||||||
newImg = true
|
newImg = true
|
||||||
}
|
}
|
||||||
if img.Elem2.Data.Group != nil {
|
if img.Elem2.Data.Group != nil {
|
||||||
rKey := img.Elem2.Data.Group.RKey.Unwrap()
|
rKey := img.Elem2.Data.Group.RKey.Unwrap()
|
||||||
url := fmt.Sprintf("https://%s%s%s&spec=0&rf=naio", domain, imgURL, rKey)
|
url := fmt.Sprintf("https://%s%s%s&spec=0&rf=naio", domain, imgURL, rKey)
|
||||||
res = append(res, &GroupImageElement{
|
res = append(res, &GroupImageElement{
|
||||||
ImageId: img.Elem1.Meta.FilePath.Unwrap(),
|
ImageId: img.Elem1.Meta.FilePath.Unwrap(),
|
||||||
Size: img.Elem1.Meta.Data.FileLen.Unwrap(),
|
Size: img.Elem1.Meta.Data.FileLen.Unwrap(),
|
||||||
Url: url,
|
Url: url,
|
||||||
Md5: img.Elem1.Meta.Data.PicMd5,
|
Md5: img.Elem1.Meta.Data.PicMd5,
|
||||||
})
|
})
|
||||||
newImg = true
|
newImg = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user