From f821ead3a16e75a16caff50baa94a5af347d6cf4 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Wed, 2 Sep 2020 10:36:00 -0400 Subject: [PATCH] Support only federating Notes When setting `notes_only = true` in the `[app]` configuration section, WF will only send out `Note` objects. Otherwise, it will send out both `Note`s and `Article`s. --- config/config.go | 1 + posts.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index 7b64e02..0fce241 100644 --- a/config/config.go +++ b/config/config.go @@ -140,6 +140,7 @@ type ( // Federation Federation bool `ini:"federation"` PublicStats bool `ini:"public_stats"` + NotesOnly bool `ini:"notes_only"` // Access Private bool `ini:"private"` diff --git a/posts.go b/posts.go index 8af0c8c..44b215c 100644 --- a/posts.go +++ b/posts.go @@ -1133,7 +1133,7 @@ func (p *PublicPost) CanonicalURL(hostName string) string { func (p *PublicPost) ActivityObject(app *App) *activitystreams.Object { cfg := app.cfg var o *activitystreams.Object - if strings.Index(p.Content, "\n\n") == -1 { + if cfg.App.NotesOnly || strings.Index(p.Content, "\n\n") == -1 { o = activitystreams.NewNoteObject() } else { o = activitystreams.NewArticleObject()