From 9d28aa5dab87aeb759cc5f6cc32f45f99d87623d Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Thu, 16 Aug 2018 20:31:25 -0400 Subject: [PATCH] Add NewUpdateActivity func --- activitystreams/activity.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/activitystreams/activity.go b/activitystreams/activity.go index a5c1644..bf77c79 100644 --- a/activitystreams/activity.go +++ b/activitystreams/activity.go @@ -40,6 +40,24 @@ func NewCreateActivity(o *Object) *Activity { return &a } +// NewUpdateActivity builds a basic Update activity that includes the given +// Object and the Object's AttributedTo property as the Actor. +func NewUpdateActivity(o *Object) *Activity { + a := Activity{ + BaseObject: BaseObject{ + Context: []interface{}{ + Namespace, + }, + ID: o.ID, + Type: "Update", + }, + Actor: o.AttributedTo, + Object: o, + Published: o.Published, + } + return &a +} + // NewDeleteActivity builds a basic Delete activity that includes the given // Object and the Object's AttributedTo property as the Actor. func NewDeleteActivity(o *Object) *Activity {