forked from indymedia/epicyon
Command to list pending follower approvals
parent
365b544d87
commit
ebcd8d771d
21
epicyon.py
21
epicyon.py
|
@ -196,6 +196,9 @@ parser.add_argument('--reply','--replyto', dest='replyto', type=str,default=None
|
||||||
parser.add_argument("--followersonly", type=str2bool, nargs='?', \
|
parser.add_argument("--followersonly", type=str2bool, nargs='?', \
|
||||||
const=True, default=True, \
|
const=True, default=True, \
|
||||||
help="Send to followers only")
|
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='?', \
|
parser.add_argument("-c","--client", type=str2bool, nargs='?', \
|
||||||
const=True, default=False, \
|
const=True, default=False, \
|
||||||
help="Use as an ActivityPub client")
|
help="Use as an ActivityPub client")
|
||||||
|
@ -320,6 +323,24 @@ useTor=args.tor
|
||||||
if domain.endswith('.onion'):
|
if domain.endswith('.onion'):
|
||||||
useTor=True
|
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 args.message:
|
||||||
if not args.nickname:
|
if not args.nickname:
|
||||||
print('Specify a nickname with the --nickname option')
|
print('Specify a nickname with the --nickname option')
|
||||||
|
|
|
@ -336,7 +336,10 @@ def receiveFollowRequest(session,baseDir: str,httpPrefix: str, \
|
||||||
domainToFollow,debug):
|
domainToFollow,debug):
|
||||||
accountsDir=baseDir+'/accounts/'+nicknameToFollow+'@'+domainToFollow
|
accountsDir=baseDir+'/accounts/'+nicknameToFollow+'@'+domainToFollow
|
||||||
if os.path.isdir(accountDir):
|
if os.path.isdir(accountDir):
|
||||||
|
if port!=80 and port!=443:
|
||||||
approveHandle=nicknameToFollow+'@'+domainToFollow+':'+str(port)
|
approveHandle=nicknameToFollow+'@'+domainToFollow+':'+str(port)
|
||||||
|
else:
|
||||||
|
approveHandle=nicknameToFollow+'@'+domainToFollow
|
||||||
approveFollowsFilename=accountDir+'/followrequests.txt'
|
approveFollowsFilename=accountDir+'/followrequests.txt'
|
||||||
if os.path.isfile(approveFollowsFilename):
|
if os.path.isfile(approveFollowsFilename):
|
||||||
if approveHandle not in open(approveFollowsFilename).read():
|
if approveHandle not in open(approveFollowsFilename).read():
|
||||||
|
|
Loading…
Reference in New Issue