Add missing fields in Account.

See https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#account

Also fixes a spurious pagination-related error.
This commit is contained in:
Ben Lubar 2018-10-20 16:47:08 -05:00 committed by mattn
parent 48920165ef
commit 61705d1f2b
2 changed files with 17 additions and 1 deletions

View File

@ -25,6 +25,17 @@ type Account struct {
AvatarStatic string `json:"avatar_static"`
Header string `json:"header"`
HeaderStatic string `json:"header_static"`
Emojis []Emoji `json:"emojis"`
Moved *Account `json:"moved"`
Fields []Field `json:"fields"`
Bot bool `json:"bot"`
}
// Field is a Mastodon account profile field.
type Field struct {
Name string `json:"name"`
Value string `json:"value"`
VerifiedAt time.Time `json:"verified_at"`
}
// GetAccount return Account.

View File

@ -258,7 +258,12 @@ func getPaginationID(rawurl, key string) (ID, error) {
return "", err
}
id, err := strconv.ParseInt(u.Query().Get(key), 10, 64)
val := u.Query().Get(key)
if val == "" {
return "", nil
}
id, err := strconv.ParseInt(val, 10, 64)
if err != nil {
return "", err
}