From 4bc0d11a7c6dcdd38732d16202caa7713397eff7 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 21 Oct 2019 17:15:12 +0100 Subject: [PATCH] Get actor for single user instance --- posts.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/posts.py b/posts.py index 4d7edbbd..8b60cb23 100644 --- a/posts.py +++ b/posts.py @@ -119,13 +119,11 @@ def getUserUrl(wfRequest: {}) -> str: for link in wfRequest['links']: if link.get('type') and link.get('href'): if link['type'] == 'application/activity+json': - if '/users/' in link['href'] or \ - '/profile/' in link['href'] or \ - '/channel/' in link['href']: - return link['href'] - else: - print('Webfinger activity+json does not contain a valid actor') - print(link['href']) + if not ('/users/' in link['href'] or \ + '/profile/' in link['href'] or \ + '/channel/' in link['href']): + print('Webfinger activity+json contains single user instance actor') + return link['href'] return None def parseUserFeed(session,feedUrl: str,asHeader: {}, \