Allow accounts follow-requests --account-id X --list
If the account ID is specified, only this follow request will be
displayed.
The filter is applied /after/ the query limits (if any), so for example
it shouldn't be used with --limit 1.
--- a/cmd/accounts.go Sun Jun 11 11:36:27 2017 +0000
+++ b/cmd/accounts.go Sat Jul 08 16:44:19 2017 +0200
@@ -411,8 +411,23 @@
if opt.list {
var followRequests []madon.Account
followRequests, err = gClient.GetAccountFollowRequests(limOpts)
- if opt.limit > 0 && len(followRequests) > int(opt.limit) {
- followRequests = followRequests[:opt.limit]
+ if opt.accountID > 0 { // Display a specific request
+ var fRequest *madon.Account
+ for _, fr := range followRequests {
+ if fr.ID == opt.accountID {
+ fRequest = &fr
+ break
+ }
+ }
+ if fRequest != nil {
+ followRequests = []madon.Account{*fRequest}
+ } else {
+ followRequests = []madon.Account{}
+ }
+ } else {
+ if opt.limit > 0 && len(followRequests) > int(opt.limit) {
+ followRequests = followRequests[:opt.limit]
+ }
}
obj = followRequests
} else {