Merge pull request #89 from writeas/comments-enabled

Support new commentsEnabled property
pull/95/head
Matt Baer 6 years ago committed by GitHub
commit 24c56af6ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      posts.go

@ -1023,7 +1023,10 @@ func fetchPost(app *app, w http.ResponseWriter, r *http.Request) error {
p.Collection = &CollectionObj{Collection: *coll}
po := p.ActivityObject()
po.Context = []interface{}{activitystreams.Namespace}
po.Context = []interface{}{
activitystreams.Namespace,
activitystreams.Extensions,
}
return impart.RenderActivityJSON(w, po, http.StatusOK)
}
@ -1093,6 +1096,9 @@ func (p *PublicPost) ActivityObject() *activitystreams.Object {
})
}
}
o.CommentsEnabled = false
return o
}
@ -1302,7 +1308,10 @@ func viewCollectionPost(app *app, w http.ResponseWriter, r *http.Request) error
} else if strings.Contains(r.Header.Get("Accept"), "application/activity+json") {
p.extractData()
ap := p.ActivityObject()
ap.Context = []interface{}{activitystreams.Namespace}
ap.Context = []interface{}{
activitystreams.Namespace,
activitystreams.Extensions,
}
return impart.RenderActivityJSON(w, ap, http.StatusOK)
} else {
p.extractData()

Loading…
Cancel
Save