Skip to content

Commit

Permalink
Add Activity.Updated field
Browse files Browse the repository at this point in the history
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
  • Loading branch information
thebaer committed Oct 2, 2023
1 parent e313cb0 commit adbbafe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions activitystreams/activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -67,6 +68,7 @@ func NewUpdateActivity(o *Object) *Activity {
Actor: o.AttributedTo,
Object: o,
Published: o.Published,
Updated: o.Updated,
}
return &a
}
Expand Down Expand Up @@ -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"`
Expand Down

0 comments on commit adbbafe

Please sign in to comment.