account.go
changeset 218 22ed9de1c5fe
parent 207 301d5b94be3f
child 226 212a0e74e719
equal deleted inserted replaced
217:cc086e49cd0c 218:22ed9de1c5fe
   197 	o := &getAccountsOptions{ID: accountID, Limit: lopt}
   197 	o := &getAccountsOptions{ID: accountID, Limit: lopt}
   198 	return mc.getMultipleAccountsHelper("following", o)
   198 	return mc.getMultipleAccountsHelper("following", o)
   199 }
   199 }
   200 
   200 
   201 // FollowAccount follows an account
   201 // FollowAccount follows an account
   202 func (mc *Client) FollowAccount(accountID int64) (*Relationship, error) {
   202 // 'reblogs' can be used to specify if boots should be displayed or hidden.
   203 	rel, err := mc.updateRelationship("follow", accountID, nil)
   203 func (mc *Client) FollowAccount(accountID int64, reblogs *bool) (*Relationship, error) {
       
   204 	var params apiCallParams
       
   205 	if reblogs != nil {
       
   206 		params = make(apiCallParams)
       
   207 		if *reblogs {
       
   208 			params["reblogs"] = "true"
       
   209 		} else {
       
   210 			params["reblogs"] = "false"
       
   211 		}
       
   212 	}
       
   213 	rel, err := mc.updateRelationship("follow", accountID, params)
   204 	if err != nil {
   214 	if err != nil {
   205 		return nil, err
   215 		return nil, err
   206 	}
   216 	}
   207 	if rel == nil {
   217 	if rel == nil {
   208 		return nil, ErrEntityNotFound
   218 		return nil, ErrEntityNotFound