From c9787530dbb75cda840b421e42aa2393aab9f7d0 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Wed, 8 Aug 2018 15:29:42 -0400 Subject: [PATCH] Support creating Delete activities --- activitystreams/activity.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/activitystreams/activity.go b/activitystreams/activity.go index dd73581..5ea9d1a 100644 --- a/activitystreams/activity.go +++ b/activitystreams/activity.go @@ -39,6 +39,23 @@ func NewCreateActivity(o *Object) *Activity { 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 { + a := Activity{ + BaseObject: BaseObject{ + Context: []interface{}{ + Namespace, + }, + ID: o.ID, + Type: "Delete", + }, + Actor: o.AttributedTo, + Object: o, + } + return &a +} + // Object is the primary base type for the Activity Streams vocabulary. type Object struct { BaseObject