From 1c728f659045d73b52f4144bce8699fef989e588 Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Thu, 15 Nov 2018 07:02:36 -0800 Subject: [PATCH] AP => webmention: fetch actor for all activity types, including replies fixes #41 --- README.md | 1 + activitypub.py | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 349c561..4178f04 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ First, install the [Google Cloud SDK](https://cloud.google.com/sdk/gcloud/) (aka Once you've done that, run this to find the App Engine libraries directory: ```sh +STATE instead use Installation Root: [/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk] gcloud info | grep -o -E '/[^:]+google_appengine' ``` diff --git a/activitypub.py b/activitypub.py index c84242f..17513dd 100644 --- a/activitypub.py +++ b/activitypub.py @@ -123,11 +123,10 @@ class InboxHandler(webapp2.RequestHandler): # TODO: verify signature if there is one # fetch actor if necessary so we have name, profile photo, etc - if type in ('Announce', 'Like', 'Follow'): - for elem in obj, activity: - actor = elem.get('actor') - if actor and isinstance(actor, basestring): - elem['actor'] = common.get_as2(actor).json() + for elem in obj, activity: + actor = elem.get('actor') + if actor and isinstance(actor, basestring): + elem['actor'] = common.get_as2(actor).json() activity_unwrapped = common.redirect_unwrap(activity) if type == 'Follow':