From ad1a4272b06ff4730627cdffae6cb9944ce7d002 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Thu, 4 Apr 2019 16:29:00 -0400 Subject: [PATCH] Support new commentsEnabled property This adds a CommentsEnabled field to the activitystreams.Object struct, as well as the Extensions needed in the Context field in order to describe the field. This is a field previously supported by PeerTube, and just recently added in PixelFed. --- activitystreams/activity.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/activitystreams/activity.go b/activitystreams/activity.go index 13ffcee..e9097d0 100644 --- a/activitystreams/activity.go +++ b/activitystreams/activity.go @@ -11,6 +11,11 @@ const ( toPublic = "https://www.w3.org/ns/activitystreams#Public" ) +var Extensions = map[string]string{ + "sc": "http://schema.org#", + "commentsEnabled": "sc:Boolean", +} + // Activity describes actions that have either already occurred, are in the // process of occurring, or may occur in the future. type Activity struct { @@ -113,6 +118,9 @@ type Object struct { Content string `json:"content"` ContentMap map[string]string `json:"contentMap,omitempty"` Tag []Tag `json:"tag"` + + // Extensions + CommentsEnabled bool `json:"commentsEnabled"` } // NewNoteObject creates a basic Note object that includes the public