merge-requests/30/head
Bob Mottram 2020-12-18 17:02:26 +00:00
parent bb31ce37cd
commit ddaa94146f
1 changed files with 15 additions and 11 deletions

View File

@ -142,16 +142,20 @@ def cleanHtml(rawHtml: str) -> str:
def getUserUrl(wfRequest: {}) -> str: def getUserUrl(wfRequest: {}) -> str:
if wfRequest.get('links'): if not wfRequest.get('links'):
return None
for link in wfRequest['links']: for link in wfRequest['links']:
if link.get('type') and link.get('href'): if not (link.get('type') and link.get('href')):
if link['type'] == 'application/activity+json': continue
if link['type'] != 'application/activity+json':
continue
if not ('/users/' in link['href'] or if not ('/users/' in link['href'] or
'/accounts/' in link['href'] or '/accounts/' in link['href'] or
'/profile/' in link['href'] or '/profile/' in link['href'] or
'/channel/' in link['href']): '/channel/' in link['href']):
print('Webfinger activity+json contains ' + print('Webfinger activity+json ' +
'single user instance actor') 'contains single user instance actor ' +
str(link))
return link['href'] return link['href']
return None return None