account.go
changeset 204 5cf1e0b45073
parent 202 30bea35361cf
child 205 b27e7d229fdd
equal deleted inserted replaced
203:c7b9ddaa41b9 204:5cf1e0b45073
   334 	return rl, nil
   334 	return rl, nil
   335 }
   335 }
   336 
   336 
   337 // GetAccountStatuses returns a list of status entities for the given account
   337 // GetAccountStatuses returns a list of status entities for the given account
   338 // If onlyMedia is true, returns only statuses that have media attachments.
   338 // If onlyMedia is true, returns only statuses that have media attachments.
       
   339 // If onlyPinned is true, returns only statuses that have been pinned.
   339 // If excludeReplies is true, skip statuses that reply to other statuses.
   340 // If excludeReplies is true, skip statuses that reply to other statuses.
   340 // If lopt.All is true, several requests will be made until the API server
   341 // If lopt.All is true, several requests will be made until the API server
   341 // has nothing to return.
   342 // has nothing to return.
   342 // If lopt.Limit is set (and not All), several queries can be made until the
   343 // If lopt.Limit is set (and not All), several queries can be made until the
   343 // limit is reached.
   344 // limit is reached.
   344 func (mc *Client) GetAccountStatuses(accountID int64, onlyMedia, excludeReplies bool, lopt *LimitParams) ([]Status, error) {
   345 func (mc *Client) GetAccountStatuses(accountID int64, onlyPinned, onlyMedia, excludeReplies bool, lopt *LimitParams) ([]Status, error) {
   345 	if accountID < 1 {
   346 	if accountID < 1 {
   346 		return nil, ErrInvalidID
   347 		return nil, ErrInvalidID
   347 	}
   348 	}
   348 
   349 
   349 	endPoint := "accounts/" + strconv.FormatInt(accountID, 10) + "/" + "statuses"
   350 	endPoint := "accounts/" + strconv.FormatInt(accountID, 10) + "/" + "statuses"
   350 	params := make(apiCallParams)
   351 	params := make(apiCallParams)
   351 	if onlyMedia {
   352 	if onlyMedia {
   352 		params["only_media"] = "true"
   353 		params["only_media"] = "true"
       
   354 	}
       
   355 	if onlyPinned {
       
   356 		params["pinned"] = "true"
   353 	}
   357 	}
   354 	if excludeReplies {
   358 	if excludeReplies {
   355 		params["exclude_replies"] = "true"
   359 		params["exclude_replies"] = "true"
   356 	}
   360 	}
   357 
   361