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.
This commit is contained in:
Matt Baer 2020-09-02 10:36:00 -04:00
parent 8be71481c8
commit f821ead3a1
2 changed files with 2 additions and 1 deletions

View file

@ -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"`

View file

@ -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()