Get actor for single user instance

main2
Bob Mottram 2019-10-21 17:15:12 +01:00
parent 515305f005
commit 4bc0d11a7c
1 changed files with 5 additions and 7 deletions

View File

@ -119,13 +119,11 @@ def getUserUrl(wfRequest: {}) -> str:
for link in wfRequest['links']: for link in wfRequest['links']:
if link.get('type') and link.get('href'): if link.get('type') and link.get('href'):
if link['type'] == 'application/activity+json': if link['type'] == 'application/activity+json':
if '/users/' in link['href'] or \ if not ('/users/' in link['href'] or \
'/profile/' in link['href'] or \ '/profile/' in link['href'] or \
'/channel/' in link['href']: '/channel/' in link['href']):
return link['href'] print('Webfinger activity+json contains single user instance actor')
else: return link['href']
print('Webfinger activity+json does not contain a valid actor')
print(link['href'])
return None return None
def parseUserFeed(session,feedUrl: str,asHeader: {}, \ def parseUserFeed(session,feedUrl: str,asHeader: {}, \