|
@ -120,14 +120,13 @@ func (s *Service) cmdGoogleImgSearch(client *gomatrix.Client, roomID, userID str |
|
|
return nil, fmt.Errorf("Failed to upload Google image to matrix: %s", err.Error()) |
|
|
return nil, fmt.Errorf("Failed to upload Google image to matrix: %s", err.Error()) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
img := searchResult.Image |
|
|
|
|
|
return gomatrix.ImageMessage{ |
|
|
return gomatrix.ImageMessage{ |
|
|
MsgType: "m.image", |
|
|
MsgType: "m.image", |
|
|
Body: querySentence, |
|
|
Body: querySentence, |
|
|
URL: resUpload.ContentURI, |
|
|
URL: resUpload.ContentURI, |
|
|
Info: gomatrix.ImageInfo{ |
|
|
Info: gomatrix.ImageInfo{ |
|
|
Height: uint(math.Floor(img.Height)), |
|
|
|
|
|
Width: uint(math.Floor(img.Width)), |
|
|
|
|
|
|
|
|
Height: uint(math.Floor(searchResult.Image.Height)), |
|
|
|
|
|
Width: uint(math.Floor(searchResult.Image.Width)), |
|
|
Mimetype: searchResult.Mime, |
|
|
Mimetype: searchResult.Mime, |
|
|
}, |
|
|
}, |
|
|
}, nil |
|
|
}, nil |
|
|