Add ability to retrieve pinned statuses only
Add support for retrieving only pinned statuses with GetAccountStatuses.
--- 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"
}