diff --git a/app/activitypub/util.py b/app/activitypub/util.py index 74776ab3..9dff6708 100644 --- a/app/activitypub/util.py +++ b/app/activitypub/util.py @@ -140,7 +140,7 @@ def post_to_activity(post: Post, community: Community): "object": { "type": "Page", "id": post.ap_id, - "attributedTo": post.author.profile_id(), + "attributedTo": post.author.profile_id() if post.author.is_local() else post.author.ap_public_url, "to": [ f"https://{current_app.config['SERVER_NAME']}/c/{community.name}", "https://www.w3.org/ns/activitystreams#Public" diff --git a/app/models.py b/app/models.py index ac30fa65..4242e785 100644 --- a/app/models.py +++ b/app/models.py @@ -625,7 +625,7 @@ class User(UserMixin, db.Model): ap_id = db.Column(db.String(255), index=True) # e.g. username@server ap_profile_id = db.Column(db.String(255), index=True) # e.g. https://server/u/username - ap_public_url = db.Column(db.String(255)) # e.g. https://server/u/username + ap_public_url = db.Column(db.String(255)) # e.g. https://server/u/UserName ap_fetched_at = db.Column(db.DateTime) ap_followers_url = db.Column(db.String(255)) ap_preferred_username = db.Column(db.String(255))