CommonFixes: more predictable context generation

`context` fields for objects and activities can now be generated based
on the object/activity `inReplyTo` field or its ActivityPub ID, as a
fallback method in cases where `context` fields are missing for incoming
activities and objects.
This commit is contained in:
Hélène 2022-08-10 04:21:28 +02:00
commit bb02ee99f5
No known key found for this signature in database
GPG key ID: A215F2E9F1589D62
4 changed files with 60 additions and 1 deletions

View file

@ -22,7 +22,10 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.CommonFixes do
end
def fix_object_defaults(data) do
context = Utils.maybe_create_context(data["context"] || data["conversation"])
context =
Utils.maybe_create_context(
data["context"] || data["conversation"] || data["inReplyTo"] || data["id"]
)
%User{follower_address: follower_collection} = User.get_cached_by_ap_id(data["attributedTo"])