mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
proper flash pic support
This commit is contained in:
parent
ca72d542ca
commit
a84b524889
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
.idea
|
.idea
|
||||||
|
vendor/
|
||||||
|
@ -2,10 +2,11 @@ package message
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/Mrs4s/MiraiGo/binary"
|
|
||||||
"github.com/Mrs4s/MiraiGo/client/pb/msg"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/Mrs4s/MiraiGo/binary"
|
||||||
|
"github.com/Mrs4s/MiraiGo/client/pb/msg"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TextElement struct {
|
type TextElement struct {
|
||||||
@ -112,6 +113,12 @@ type RedBagElement struct {
|
|||||||
Title string
|
Title string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: 总之就是非常傻逼
|
||||||
|
|
||||||
|
type GroupFlashImgElement struct {
|
||||||
|
ImageElement
|
||||||
|
}
|
||||||
|
|
||||||
type GroupFlashPicElement struct {
|
type GroupFlashPicElement struct {
|
||||||
GroupImageElement
|
GroupImageElement
|
||||||
}
|
}
|
||||||
@ -121,6 +128,10 @@ type GroupShowPicElement struct {
|
|||||||
EffectId int32
|
EffectId int32
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type FriendFlashImgElement struct {
|
||||||
|
ImageElement
|
||||||
|
}
|
||||||
|
|
||||||
type FriendFlashPicElement struct {
|
type FriendFlashPicElement struct {
|
||||||
FriendImageElement
|
FriendImageElement
|
||||||
}
|
}
|
||||||
|
@ -2,16 +2,17 @@ package message
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/md5"
|
"crypto/md5"
|
||||||
"github.com/Mrs4s/MiraiGo/binary"
|
|
||||||
"github.com/Mrs4s/MiraiGo/client/pb/msg"
|
|
||||||
"github.com/Mrs4s/MiraiGo/utils"
|
|
||||||
"github.com/golang/protobuf/proto"
|
|
||||||
"github.com/tidwall/gjson"
|
|
||||||
"math"
|
"math"
|
||||||
"reflect"
|
"reflect"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/Mrs4s/MiraiGo/binary"
|
||||||
|
"github.com/Mrs4s/MiraiGo/client/pb/msg"
|
||||||
|
"github.com/Mrs4s/MiraiGo/utils"
|
||||||
|
"github.com/golang/protobuf/proto"
|
||||||
|
"github.com/tidwall/gjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
@ -480,19 +481,23 @@ func ParseMessageElems(elems []*msg.Elem) []IMessageElement {
|
|||||||
flash := &msg.MsgElemInfoServtype3{}
|
flash := &msg.MsgElemInfoServtype3{}
|
||||||
_ = proto.Unmarshal(elem.CommonElem.PbElem, flash)
|
_ = proto.Unmarshal(elem.CommonElem.PbElem, flash)
|
||||||
if flash.FlashTroopPic != nil {
|
if flash.FlashTroopPic != nil {
|
||||||
res = append(res, &ImageElement{
|
res = append(res, &GroupFlashImgElement{
|
||||||
Filename: flash.FlashTroopPic.FilePath,
|
ImageElement{
|
||||||
Size: flash.FlashTroopPic.Size,
|
Filename: flash.FlashTroopPic.FilePath,
|
||||||
Width: flash.FlashTroopPic.Width,
|
Size: flash.FlashTroopPic.Size,
|
||||||
Height: flash.FlashTroopPic.Height,
|
Width: flash.FlashTroopPic.Width,
|
||||||
Md5: flash.FlashTroopPic.Md5,
|
Height: flash.FlashTroopPic.Height,
|
||||||
|
Md5: flash.FlashTroopPic.Md5,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if flash.FlashC2CPic != nil {
|
if flash.FlashC2CPic != nil {
|
||||||
res = append(res, &ImageElement{
|
res = append(res, &GroupFlashImgElement{
|
||||||
Filename: flash.FlashC2CPic.FilePath,
|
ImageElement{
|
||||||
Size: flash.FlashC2CPic.FileLen,
|
Filename: flash.FlashC2CPic.FilePath,
|
||||||
Md5: flash.FlashC2CPic.PicMd5,
|
Size: flash.FlashC2CPic.FileLen,
|
||||||
|
Md5: flash.FlashC2CPic.PicMd5,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user