Skip to content

Commit ad1a427

Browse files
committed
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.
1 parent ce8cb5e commit ad1a427

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

activitystreams/activity.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ const (
1111
toPublic = "https://www.w3.org/ns/activitystreams#Public"
1212
)
1313

14+
var Extensions = map[string]string{
15+
"sc": "http://schema.org#",
16+
"commentsEnabled": "sc:Boolean",
17+
}
18+
1419
// Activity describes actions that have either already occurred, are in the
1520
// process of occurring, or may occur in the future.
1621
type Activity struct {
@@ -113,6 +118,9 @@ type Object struct {
113118
Content string `json:"content"`
114119
ContentMap map[string]string `json:"contentMap,omitempty"`
115120
Tag []Tag `json:"tag"`
121+
122+
// Extensions
123+
CommentsEnabled bool `json:"commentsEnabled"`
116124
}
117125

118126
// NewNoteObject creates a basic Note object that includes the public

0 commit comments

Comments
 (0)