diff --git a/config/config.go b/config/config.go index cfb5999..3a5588b 100644 --- a/config/config.go +++ b/config/config.go @@ -143,6 +143,7 @@ type ( Federation bool `ini:"federation"` PublicStats bool `ini:"public_stats"` Monetization bool `ini:"monetization"` + NotesOnly bool `ini:"notes_only"` // Access Private bool `ini:"private"` diff --git a/posts.go b/posts.go index d5f34bc..0fe29b9 100644 --- a/posts.go +++ b/posts.go @@ -1131,7 +1131,12 @@ func (p *PublicPost) CanonicalURL(hostName string) string { func (p *PublicPost) ActivityObject(app *App) *activitystreams.Object { cfg := app.cfg - o := activitystreams.NewArticleObject() + var o *activitystreams.Object + if cfg.App.NotesOnly || strings.Index(p.Content, "\n\n") == -1 { + o = activitystreams.NewNoteObject() + } else { + o = activitystreams.NewArticleObject() + } o.ID = p.Collection.FederatedAPIBase() + "api/posts/" + p.ID o.Published = p.Created o.URL = p.CanonicalURL(cfg.App.Host)