Browse Source

Comments to show intended structure use

pull/159/head
Richard Lewis 7 years ago
parent
commit
ec97260b18
  1. 2
      src/github.com/matrix-org/go-neb/services/google/google.go
  2. 3
      src/github.com/matrix-org/go-neb/services/wikipedia/wikipedia.go

2
src/github.com/matrix-org/go-neb/services/google/google.go

@ -123,7 +123,7 @@ func (s *Service) cmdGoogleImgSearch(client *gomatrix.Client, roomID, userID str
// FIXME -- Sometimes upload fails with a cryptic error - "msg=Upload request failed code=400"
resUpload, err := client.UploadLink(imgURL)
if err != nil {
return nil, fmt.Errorf("Failed to upload Google image to matrix: %s", err.Error())
return nil, fmt.Errorf("Failed to upload Google image at URL %s (content type %s) to matrix: %s", imgURL, searchResult.Mime, err.Error())
}
return gomatrix.ImageMessage{

3
src/github.com/matrix-org/go-neb/services/wikipedia/wikipedia.go

@ -21,14 +21,17 @@ const maxExtractLength = 1024 // Max length of extract string in bytes
var httpClient = &http.Client{}
// Search results (returned by search query)
type wikipediaSearchResults struct {
Query wikipediaQuery `json:"query"`
}
// Wikipeda pages returned in search results
type wikipediaQuery struct {
Pages map[string]wikipediaPage `json:"pages"`
}
// Representation of an individual wikipedia page
type wikipediaPage struct {
PageID int64 `json:"pageid"`
NS int `json:"ns"`

Loading…
Cancel
Save