diff --git a/activityPub.go b/activityPub.go index 4ca0acb..a549986 100644 --- a/activityPub.go +++ b/activityPub.go @@ -213,10 +213,6 @@ func (p *post) apPost() { if !appConfig.ActivityPub.Enabled { return } - if p.Published == "" || p.Section == "" { - // No section, don't post - return - } n := p.toASNote() createActivity := make(map[string]interface{}) createActivity["@context"] = asContext @@ -232,10 +228,6 @@ func (p *post) apUpdate() { if !appConfig.ActivityPub.Enabled { return } - if p.Published == "" || p.firstParameter("section") == "" { - // No section, don't post - return - } n := p.toASNote() updateActivity := make(map[string]interface{}) updateActivity["@context"] = asContext diff --git a/hooks.go b/hooks.go index 27adb66..ca13f11 100644 --- a/hooks.go +++ b/hooks.go @@ -26,8 +26,11 @@ func (p *post) postPostHooks() { }) }(p, cmdTmplString) } - go p.apPost() - go p.tgPost() + if p.Published != "" && p.Section != "" { + // It's a published post + go p.apPost() + go p.tgPost() + } go p.sendWebmentions() } @@ -40,7 +43,10 @@ func (p *post) postUpdateHooks() { }) }(p, cmdTmplString) } - go p.apUpdate() + if p.Published != "" && p.Section != "" { + // It's a published post + go p.apUpdate() + } go p.sendWebmentions() }