# HG changeset patch # User Mikael Berthe # Date 1499525059 -7200 # Node ID 452865b363fb1e1c49e4f10bd7ffe31fd37eb467 # Parent d3ec5a39c2d87cc3251b36d5950793560eef996c 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. diff -r d3ec5a39c2d8 -r 452865b363fb cmd/accounts.go --- 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 {