1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00
This commit is contained in:
Mrs4s 2020-07-18 04:32:09 +08:00
parent c603318431
commit 5ead51215a
2 changed files with 3 additions and 0 deletions

View File

@ -288,6 +288,7 @@ 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,
Size: elem.CustomFace.Size,
Url: func() string { Url: func() string {
if elem.CustomFace.OrigUrl == "" { 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/gchatpic_new/0/0-0-" + strings.ReplaceAll(binary.CalculateImageResourceId(elem.CustomFace.Md5)[1:37], "-", "") + "/0?term=2"
@ -306,6 +307,7 @@ func parseMessageElems(elems []*msg.Elem) []message.IMessageElement {
} }
res = append(res, &message.ImageElement{ res = append(res, &message.ImageElement{
Filename: elem.NotOnlineImage.FilePath, Filename: elem.NotOnlineImage.FilePath,
Size: elem.NotOnlineImage.FileLen,
Url: img, Url: img,
Md5: elem.NotOnlineImage.PicMd5, Md5: elem.NotOnlineImage.PicMd5,
}) })

View File

@ -11,6 +11,7 @@ type TextElement struct {
type ImageElement struct { type ImageElement struct {
Filename string Filename string
Size int32
Url string Url string
Md5 []byte Md5 []byte
Data []byte Data []byte