From 9cace6b29130300f9ab2035f319751247ccbbcad Mon Sep 17 00:00:00 2001 From: 178inaba <178inaba@users.noreply.github.com> Date: Fri, 14 Apr 2017 15:46:21 +0900 Subject: [PATCH 1/2] Add GetAccountCurrentUser --- mastodon.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mastodon.go b/mastodon.go index e7686bb..373fac5 100644 --- a/mastodon.go +++ b/mastodon.go @@ -215,6 +215,16 @@ func (c *Client) GetAccount(id int) (*Account, error) { return &account, nil } +// GetAccountCurrentUser return current user Account. +func (c *Client) GetAccountCurrentUser() (*Account, error) { + var account Account + err := c.doAPI("GET", "/api/v1/accounts/verify_credentials", nil, &account) + if err != nil { + return nil, err + } + return &account, nil +} + // GetAccountFollowers return followers list. func (c *Client) GetAccountFollowers(id int64) ([]*Account, error) { var accounts []*Account From 1182d1e6622f71337a6c09194d517e0bb7100c02 Mon Sep 17 00:00:00 2001 From: 178inaba <178inaba@users.noreply.github.com> Date: Fri, 14 Apr 2017 15:56:24 +0900 Subject: [PATCH 2/2] Fix comment of GetAccountCurrentUser --- mastodon.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mastodon.go b/mastodon.go index 373fac5..94f6a7b 100644 --- a/mastodon.go +++ b/mastodon.go @@ -215,7 +215,7 @@ func (c *Client) GetAccount(id int) (*Account, error) { return &account, nil } -// GetAccountCurrentUser return current user Account. +// GetAccountCurrentUser return Account of current user. func (c *Client) GetAccountCurrentUser() (*Account, error) { var account Account err := c.doAPI("GET", "/api/v1/accounts/verify_credentials", nil, &account)