From adbbafe3ee0c9693b7fc82a0b647b90fdc0b1540 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Mon, 2 Oct 2023 19:27:51 -0400 Subject: [PATCH] Add Activity.Updated field Per the Mastodon docs, we need to send an `updated` parameter for `Update` activities to work correctly. https://docs.joinmastodon.org/spec/activitypub/#supported-activities-for-statuses --- activitystreams/activity.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/activitystreams/activity.go b/activitystreams/activity.go index ebb118f..cfdab0d 100644 --- a/activitystreams/activity.go +++ b/activitystreams/activity.go @@ -19,6 +19,7 @@ type Activity struct { BaseObject Actor string `json:"actor"` Published time.Time `json:"published,omitempty"` + Updated time.Time `json:"updated,omitempty"` To []string `json:"to,omitempty"` CC []string `json:"cc,omitempty"` Object *Object `json:"object"` @@ -67,6 +68,7 @@ func NewUpdateActivity(o *Object) *Activity { Actor: o.AttributedTo, Object: o, Published: o.Published, + Updated: o.Updated, } return &a } @@ -107,6 +109,7 @@ func NewFollowActivity(actorIRI, followeeIRI string) *FollowActivity { type Object struct { BaseObject Published time.Time `json:"published,omitempty"` + Updated time.Time `json:"updated,omitempty"` Summary *string `json:"summary,omitempty"` InReplyTo *string `json:"inReplyTo,omitempty"` URL string `json:"url"`