Merge pull request #431 from Dak425/stop-federating-protected-and-private-blogs

Stop private and protected blogs from federating
This commit is contained in:
Matt Baer 2021-04-07 10:54:28 -04:00 committed by GitHub
commit 4228761eb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -662,6 +662,16 @@ func deleteFederatedPost(app *App, p *PublicPost, collID int64) error {
}
func federatePost(app *App, p *PublicPost, collID int64, isUpdate bool) error {
// If app is private, do not federate
if app.cfg.App.Private {
return nil
}
// Do not federate posts from private or protected blogs
if p.Collection.Visibility == CollPrivate || p.Collection.Visibility == CollProtected {
return nil
}
if debugging {
if isUpdate {
log.Info("Federating updated post!")
@ -669,6 +679,7 @@ func federatePost(app *App, p *PublicPost, collID int64, isUpdate bool) error {
log.Info("Federating new post!")
}
}
actor := p.Collection.PersonObject(collID)
na := p.ActivityObject(app)