Skip to content

Commit

Permalink
add image file name
Browse files Browse the repository at this point in the history
  • Loading branch information
Fripine committed Sep 5, 2024
1 parent 1faca7c commit 47b45f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions message/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type GroupImageElement struct {
Height int32
Md5 []byte
Url string

Name string
// EffectID show pic effect id.
EffectID int32
Flash bool
Expand All @@ -32,8 +32,8 @@ type FriendImageElement struct {
Width int32
Height int32
Url string

Flash bool
Name string
Flash bool
}

type GuildImageElement struct {
Expand Down
6 changes: 4 additions & 2 deletions message/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -680,23 +680,25 @@ func ParseMessageElems(elems []*msg.Elem) []IMessageElement {
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)
url := fmt.Sprintf("https://%s%s%s", 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.FileMd5,
Name: img.Elem1.Meta.Data.FileName.Unwrap(),
})
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)
url := fmt.Sprintf("https://%s%s%s", 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.FileMd5,
Name: img.Elem1.Meta.Data.FileName.Unwrap(),
})
newImg = true
}
Expand Down

0 comments on commit 47b45f8

Please sign in to comment.