diff options
-rw-r--r-- | main.go | 19 | ||||
-rw-r--r-- | outboxPost.go | 2 | ||||
-rw-r--r-- | static/faq.html | 2 |
3 files changed, 14 insertions, 9 deletions
@@ -1120,12 +1120,19 @@ func main() { } } - if !alreadyIndex { - query := `insert into follower (id, follower) values ($1, $2)` + // delay to give instance time to boot up + time.Sleep(15 * time.Second) - _, err := db.Exec(query, "https://fchan.xyz", actor) + checkActor := GetActor(actor) - CheckError(err, "Error with add to index query") + if checkActor.Id == actor { + if !alreadyIndex { + query := `insert into follower (id, follower) values ($1, $2)` + + _, err := db.Exec(query, "https://fchan.xyz", actor) + + CheckError(err, "Error with add to index query") + } } }) @@ -1350,9 +1357,7 @@ func CreateObject(objType string) ObjectBase { func AddFollowersToActivity(db *sql.DB, activity Activity) Activity{ - if len(activity.To) < 1 { - activity.To = append(activity.To, activity.Actor.Id) - } + activity.To = append(activity.To, activity.Actor.Id) for _, e := range activity.To { aFollowers := GetActorCollection(e + "/followers") diff --git a/outboxPost.go b/outboxPost.go index cc66677..45093b8 100644 --- a/outboxPost.go +++ b/outboxPost.go @@ -48,7 +48,7 @@ func ParseOutboxRequest(w http.ResponseWriter, r *http.Request, db *sql.DB) { nObj = WriteObjectToDB(db, nObj) activity := CreateActivity("Create", nObj) activity = AddFollowersToActivity(db, activity) - MakeActivityRequest(db, activity) + go MakeActivityRequest(db, activity) var id string op := len(nObj.InReplyTo) - 1 diff --git a/static/faq.html b/static/faq.html index c5f98d2..00b8342 100644 --- a/static/faq.html +++ b/static/faq.html @@ -37,7 +37,7 @@ <p>coming soon(tm).</p> <h4>Server Version</h4> - <p>v0.0.4</p> + <p>v0.0.5</p> </div> <div style="width: 500px; margin:0 auto; margin-top: 50px; text-align: center;"> <a href="/">[Home]</a><a href="/static/rules.html">[Rules]</a><a href="/static/faq.html">[FAQ]</a> |