account.go
changeset 152 d9e73e9df9c6
parent 149 5f922977d7c7
child 155 0c581e0108da
equal deleted inserted replaced
151:f87b6ca9de6d 152:d9e73e9df9c6
   133 	return account, nil
   133 	return account, nil
   134 }
   134 }
   135 
   135 
   136 // GetAccountFollowers returns the list of accounts following a given account
   136 // GetAccountFollowers returns the list of accounts following a given account
   137 func (mc *Client) GetAccountFollowers(accountID int, lopt *LimitParams) ([]Account, error) {
   137 func (mc *Client) GetAccountFollowers(accountID int, lopt *LimitParams) ([]Account, error) {
   138 	o := &getAccountsOptions{ID: accountID}
   138 	o := &getAccountsOptions{ID: accountID, Limit: lopt}
   139 	return mc.getMultipleAccounts("followers", o)
   139 	return mc.getMultipleAccounts("followers", o)
   140 }
   140 }
   141 
   141 
   142 // GetAccountFollowing returns the list of accounts a given account is following
   142 // GetAccountFollowing returns the list of accounts a given account is following
   143 func (mc *Client) GetAccountFollowing(accountID int, lopt *LimitParams) ([]Account, error) {
   143 func (mc *Client) GetAccountFollowing(accountID int, lopt *LimitParams) ([]Account, error) {
   144 	o := &getAccountsOptions{ID: accountID}
   144 	o := &getAccountsOptions{ID: accountID, Limit: lopt}
   145 	return mc.getMultipleAccounts("following", o)
   145 	return mc.getMultipleAccounts("following", o)
   146 }
   146 }
   147 
   147 
   148 // FollowAccount follows an account
   148 // FollowAccount follows an account
   149 func (mc *Client) FollowAccount(accountID int) error {
   149 func (mc *Client) FollowAccount(accountID int) error {
   243 	o := &getAccountsOptions{Q: query, Limit: lopt}
   243 	o := &getAccountsOptions{Q: query, Limit: lopt}
   244 	return mc.getMultipleAccounts("search", o)
   244 	return mc.getMultipleAccounts("search", o)
   245 }
   245 }
   246 
   246 
   247 // GetBlockedAccounts returns the list of blocked accounts
   247 // GetBlockedAccounts returns the list of blocked accounts
       
   248 // The lopt parameter is optional (can be nil).
   248 func (mc *Client) GetBlockedAccounts(lopt *LimitParams) ([]Account, error) {
   249 func (mc *Client) GetBlockedAccounts(lopt *LimitParams) ([]Account, error) {
   249 	return mc.getMultipleAccounts("blocks", nil)
   250 	o := &getAccountsOptions{Limit: lopt}
       
   251 	return mc.getMultipleAccounts("blocks", o)
   250 }
   252 }
   251 
   253 
   252 // GetMutedAccounts returns the list of muted accounts
   254 // GetMutedAccounts returns the list of muted accounts
       
   255 // The lopt parameter is optional (can be nil).
   253 func (mc *Client) GetMutedAccounts(lopt *LimitParams) ([]Account, error) {
   256 func (mc *Client) GetMutedAccounts(lopt *LimitParams) ([]Account, error) {
   254 	return mc.getMultipleAccounts("mutes", nil)
   257 	o := &getAccountsOptions{Limit: lopt}
       
   258 	return mc.getMultipleAccounts("mutes", o)
   255 }
   259 }
   256 
   260 
   257 // GetAccountFollowRequests returns the list of follow requests accounts
   261 // GetAccountFollowRequests returns the list of follow requests accounts
       
   262 // The lopt parameter is optional (can be nil).
   258 func (mc *Client) GetAccountFollowRequests(lopt *LimitParams) ([]Account, error) {
   263 func (mc *Client) GetAccountFollowRequests(lopt *LimitParams) ([]Account, error) {
   259 	return mc.getMultipleAccounts("follow_requests", nil)
   264 	o := &getAccountsOptions{Limit: lopt}
       
   265 	return mc.getMultipleAccounts("follow_requests", o)
   260 }
   266 }
   261 
   267 
   262 // GetAccountRelationships returns a list of relationship entities for the given accounts
   268 // GetAccountRelationships returns a list of relationship entities for the given accounts
   263 func (mc *Client) GetAccountRelationships(accountIDs []int) ([]Relationship, error) {
   269 func (mc *Client) GetAccountRelationships(accountIDs []int) ([]Relationship, error) {
   264 	if len(accountIDs) < 1 {
   270 	if len(accountIDs) < 1 {