mirror of
https://github.com/writefreely/writefreely
synced 2024-12-01 04:49:09 +00:00
Merge pull request #431 from Dak425/stop-federating-protected-and-private-blogs
Stop private and protected blogs from federating
This commit is contained in:
commit
4228761eb3
1 changed files with 11 additions and 0 deletions
|
@ -662,6 +662,16 @@ func deleteFederatedPost(app *App, p *PublicPost, collID int64) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func federatePost(app *App, p *PublicPost, collID int64, isUpdate bool) 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 debugging {
|
||||||
if isUpdate {
|
if isUpdate {
|
||||||
log.Info("Federating updated post!")
|
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!")
|
log.Info("Federating new post!")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
actor := p.Collection.PersonObject(collID)
|
actor := p.Collection.PersonObject(collID)
|
||||||
na := p.ActivityObject(app)
|
na := p.ActivityObject(app)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue