mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-05 03:23:50 +08:00
fix group image url error.
This commit is contained in:
parent
223e464c94
commit
c603318431
@ -11,6 +11,7 @@ import (
|
|||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"sort"
|
"sort"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DeviceInfo struct {
|
type DeviceInfo struct {
|
||||||
@ -287,7 +288,12 @@ func parseMessageElems(elems []*msg.Elem) []message.IMessageElement {
|
|||||||
if elem.CustomFace != nil {
|
if elem.CustomFace != nil {
|
||||||
res = append(res, &message.ImageElement{
|
res = append(res, &message.ImageElement{
|
||||||
Filename: elem.CustomFace.FilePath,
|
Filename: elem.CustomFace.FilePath,
|
||||||
Url: "http://gchat.qpic.cn" + elem.CustomFace.OrigUrl,
|
Url: func() string {
|
||||||
|
if elem.CustomFace.OrigUrl == "" {
|
||||||
|
return "http://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.OrigUrl
|
||||||
|
}(),
|
||||||
Md5: elem.CustomFace.Md5,
|
Md5: elem.CustomFace.Md5,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user