Add ability to retrieve pinned statuses only
authorMikael Berthe <mikael@lilotux.net>
Mon, 19 Mar 2018 11:41:20 +0100
changeset 204 5cf1e0b45073
parent 203 c7b9ddaa41b9
child 205 b27e7d229fdd
Add ability to retrieve pinned statuses only Add support for retrieving only pinned statuses with GetAccountStatuses.
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"
 	}