diff --git a/epicyon.py b/epicyon.py index 8a9ffc61..2d885b4e 100644 --- a/epicyon.py +++ b/epicyon.py @@ -196,6 +196,9 @@ parser.add_argument('--reply','--replyto', dest='replyto', type=str,default=None parser.add_argument("--followersonly", type=str2bool, nargs='?', \ const=True, default=True, \ help="Send to followers only") +parser.add_argument("--followerspending", type=str2bool, nargs='?', \ + const=True, default=True, \ + help="Show a list of followers pending") parser.add_argument("-c","--client", type=str2bool, nargs='?', \ const=True, default=False, \ help="Use as an ActivityPub client") @@ -320,6 +323,24 @@ useTor=args.tor if domain.endswith('.onion'): useTor=True +if args.followerspending: + if not args.nickname: + print('Specify a nickname with the --nickname option') + sys.exit() + + accountsDir=baseDir+'/accounts/'+args.nickname+'@'+domain + approveFollowsFilename=accountDir+'/followrequests.txt' + approveCtr=0 + if os.path.isfile(approveFollowsFilename): + with open(approveFollowsFilename, 'r') as approvefile: + for approve in approvefile: + print(approve.replace('\n','')) + approveCtr+=1 + if approveCtr==0: + print('There are no follow requests pending approval.') + sys.exit() + + if args.message: if not args.nickname: print('Specify a nickname with the --nickname option') diff --git a/follow.py b/follow.py index 46f2094d..06bec9a4 100644 --- a/follow.py +++ b/follow.py @@ -336,7 +336,10 @@ def receiveFollowRequest(session,baseDir: str,httpPrefix: str, \ domainToFollow,debug): accountsDir=baseDir+'/accounts/'+nicknameToFollow+'@'+domainToFollow if os.path.isdir(accountDir): - approveHandle=nicknameToFollow+'@'+domainToFollow+':'+str(port) + if port!=80 and port!=443: + approveHandle=nicknameToFollow+'@'+domainToFollow+':'+str(port) + else: + approveHandle=nicknameToFollow+'@'+domainToFollow approveFollowsFilename=accountDir+'/followrequests.txt' if os.path.isfile(approveFollowsFilename): if approveHandle not in open(approveFollowsFilename).read():