# HG changeset patch # User Mikael Berthe # Date 1521456080 -3600 # Node ID 5cf1e0b45073b54e92add4332f025a09c9ad293d # Parent c7b9ddaa41b9ff35109ac787b6c3ba271b25dbe4 Add ability to retrieve pinned statuses only Add support for retrieving only pinned statuses with GetAccountStatuses. diff -r c7b9ddaa41b9 -r 5cf1e0b45073 account.go --- a/account.go Mon Mar 19 11:28:37 2018 +0100 +++ b/account.go Mon Mar 19 11:41:20 2018 +0100 @@ -336,12 +336,13 @@ // GetAccountStatuses returns a list of status entities for the given account // If onlyMedia is true, returns only statuses that have media attachments. +// If onlyPinned is true, returns only statuses that have been pinned. // If excludeReplies is true, skip statuses that reply to other statuses. // If lopt.All is true, several requests will be made until the API server // has nothing to return. // If lopt.Limit is set (and not All), several queries can be made until the // limit is reached. -func (mc *Client) GetAccountStatuses(accountID int64, onlyMedia, excludeReplies bool, lopt *LimitParams) ([]Status, error) { +func (mc *Client) GetAccountStatuses(accountID int64, onlyPinned, onlyMedia, excludeReplies bool, lopt *LimitParams) ([]Status, error) { if accountID < 1 { return nil, ErrInvalidID } @@ -351,6 +352,9 @@ if onlyMedia { params["only_media"] = "true" } + if onlyPinned { + params["pinned"] = "true" + } if excludeReplies { params["exclude_replies"] = "true" }