forked from indymedia/epicyon
Use actor if webfinger fails
parent
9ac770dc50
commit
2f716975e4
10
epicyon.py
10
epicyon.py
|
@ -842,6 +842,7 @@ if args.dat:
|
||||||
httpPrefix='dat'
|
httpPrefix='dat'
|
||||||
|
|
||||||
if args.actor:
|
if args.actor:
|
||||||
|
originalActor=args.actor
|
||||||
if '/@' in args.actor or '/users/' in args.actor or args.actor.startswith('http') or args.actor.startswith('dat'):
|
if '/@' in args.actor or '/users/' in args.actor or args.actor.startswith('http') or args.actor.startswith('dat'):
|
||||||
# format: https://domain/@nick
|
# format: https://domain/@nick
|
||||||
args.actor=args.actor.replace('https://','').replace('http://','').replace('dat://','').replace('/@','/users/')
|
args.actor=args.actor.replace('https://','').replace('http://','').replace('dat://','').replace('/@','/users/')
|
||||||
|
@ -883,12 +884,17 @@ if args.actor:
|
||||||
print('Unable to webfinger '+nickname+'@'+domain)
|
print('Unable to webfinger '+nickname+'@'+domain)
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
personUrl=None
|
||||||
if wfRequest.get('errors'):
|
if wfRequest.get('errors'):
|
||||||
print('wfRequest error: '+str(wfRequest['errors']))
|
print('wfRequest error: '+str(wfRequest['errors']))
|
||||||
sys.exit()
|
if '/users/' in args.actor:
|
||||||
|
personUrl=originalActor
|
||||||
|
else:
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
asHeader = {'Accept': 'application/activity+json; profile="https://www.w3.org/ns/activitystreams"'}
|
asHeader = {'Accept': 'application/activity+json; profile="https://www.w3.org/ns/activitystreams"'}
|
||||||
personUrl = getUserUrl(wfRequest)
|
if not personUrl:
|
||||||
|
personUrl = getUserUrl(wfRequest)
|
||||||
if nickname==domain:
|
if nickname==domain:
|
||||||
personUrl=personUrl.replace('/users/','/actor/')
|
personUrl=personUrl.replace('/users/','/actor/')
|
||||||
#print('personUrl: '+personUrl)
|
#print('personUrl: '+personUrl)
|
||||||
|
|
Loading…
Reference in New Issue