diff --git a/activitystreams/activity.go b/activitystreams/activity.go index b1a5340..a94de75 100644 --- a/activitystreams/activity.go +++ b/activitystreams/activity.go @@ -5,7 +5,8 @@ import ( ) const ( - toPublic = "https://www.w3.org/ns/activitystreams#Public" + Namespace = "https://www.w3.org/ns/activitystreams" + toPublic = "https://www.w3.org/ns/activitystreams#Public" ) type Activity struct { @@ -21,7 +22,7 @@ func NewCreateActivity(o *Object) *Activity { a := Activity{ BaseObject: BaseObject{ Context: []interface{}{ - "https://www.w3.org/ns/activitystreams", + Namespace, }, ID: o.ID + "/activity", Type: "Create", diff --git a/activitystreams/data.go b/activitystreams/data.go index e107d36..4197171 100644 --- a/activitystreams/data.go +++ b/activitystreams/data.go @@ -38,7 +38,7 @@ func NewOrderedCollection(accountRoot, collType string, items int) *OrderedColle oc := OrderedCollection{ BaseObject: BaseObject{ Context: []interface{}{ - "https://www.w3.org/ns/activitystreams", + Namespace, }, ID: accountRoot + "/" + collType, Type: "OrderedCollection", @@ -62,7 +62,7 @@ func NewOrderedCollectionPage(accountRoot, collType string, items, page int) *Or ocp := OrderedCollectionPage{ BaseObject: BaseObject{ Context: []interface{}{ - "https://www.w3.org/ns/activitystreams", + Namespace, }, ID: fmt.Sprintf("%s/%s?page=%d", accountRoot, collType, page), Type: "OrderedCollectionPage", diff --git a/activitystreams/person.go b/activitystreams/person.go index 7b93726..b878d2c 100644 --- a/activitystreams/person.go +++ b/activitystreams/person.go @@ -20,7 +20,7 @@ func NewPerson(accountRoot string) *Person { BaseObject: BaseObject{ Type: "Person", Context: []interface{}{ - "https://www.w3.org/ns/activitystreams", + Namespace, }, ID: accountRoot, },