Add NewUpdateActivity func

This commit is contained in:
Matt Baer
2018-08-16 20:31:25 -04:00
parent b9e200c53b
commit 9d28aa5dab
+18
View File
@@ -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 {