mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-07-08 15:18:32 +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 永远为单独消息
|
||||
case 48:
|
||||
img := &msg.PbMultiMediaElement{}
|
||||
_ = proto.Unmarshal(elem.CommonElem.PbElem, img)
|
||||
domain := img.Elem1.Data.Domain.Unwrap()
|
||||
imgURL := img.Elem1.Data.ImgURL.Unwrap()
|
||||
bt := elem.CommonElem.BusinessType.Unwrap()
|
||||
// 20 for group, 10 for friend, 22 or 12 for voice record
|
||||
if bt == 20 || bt == 10 {
|
||||
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 {
|
||||
rKey := img.Elem2.Data.Friend.RKey.Unwrap()
|
||||
url := fmt.Sprintf("https://%s%s%s&spec=0&rf=naio", domain, imgURL, rKey)
|
||||
res = append(res, &FriendImageElement{
|
||||
ImageId: img.Elem1.Meta.FilePath.Unwrap(),
|
||||
Size: img.Elem1.Meta.Data.FileLen.Unwrap(),
|
||||
Url: url,
|
||||
Md5: img.Elem1.Meta.Data.PicMd5,
|
||||
})
|
||||
newImg = true
|
||||
}
|
||||
if img.Elem2.Data.Group != nil {
|
||||
rKey := img.Elem2.Data.Group.RKey.Unwrap()
|
||||
url := fmt.Sprintf("https://%s%s%s&spec=0&rf=naio", domain, imgURL, rKey)
|
||||
res = append(res, &GroupImageElement{
|
||||
ImageId: img.Elem1.Meta.FilePath.Unwrap(),
|
||||
Size: img.Elem1.Meta.Data.FileLen.Unwrap(),
|
||||
Url: url,
|
||||
Md5: img.Elem1.Meta.Data.PicMd5,
|
||||
})
|
||||
newImg = true
|
||||
if img.Elem2.Data.Friend != nil {
|
||||
rKey := img.Elem2.Data.Friend.RKey.Unwrap()
|
||||
url := fmt.Sprintf("https://%s%s%s&spec=0&rf=naio", domain, imgURL, rKey)
|
||||
res = append(res, &FriendImageElement{
|
||||
ImageId: img.Elem1.Meta.FilePath.Unwrap(),
|
||||
Size: img.Elem1.Meta.Data.FileLen.Unwrap(),
|
||||
Url: url,
|
||||
Md5: img.Elem1.Meta.Data.PicMd5,
|
||||
})
|
||||
newImg = true
|
||||
}
|
||||
if img.Elem2.Data.Group != nil {
|
||||
rKey := img.Elem2.Data.Group.RKey.Unwrap()
|
||||
url := fmt.Sprintf("https://%s%s%s&spec=0&rf=naio", domain, imgURL, rKey)
|
||||
res = append(res, &GroupImageElement{
|
||||
ImageId: img.Elem1.Meta.FilePath.Unwrap(),
|
||||
Size: img.Elem1.Meta.Data.FileLen.Unwrap(),
|
||||
Url: url,
|
||||
Md5: img.Elem1.Meta.Data.PicMd5,
|
||||
})
|
||||
newImg = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user