hack around ignoring 'to' URIs that end in /followers

may remove the entire associated for-loop...
This commit is contained in:
farhan 2021-01-04 18:40:11 +00:00
parent d02ae808a1
commit 81b06d64e8

View File

@ -143,12 +143,15 @@ func check_post(uri string) (PostJson, error) {
_, err = pool.Exec(context.Background(), "INSERT INTO posts (id, inreplyto, published, summary, content, normalized, attributedto, posthash, instance) VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9)", postjson.ID, postjson.InReplyTo, postjson.Published, postjson.Summary, postjson.Content, postjson.normalized, postjson.AttributedTo, postjson.posthash, postjson.instance)
if err != nil {
// log.Print("INSERT posts error of " + uri + ": ", err)
return postjson, err
}
for _, to := range postjson.To {
if to != "https://www.w3.org/ns/activitystreams#Public" && to != "" {
if strings.HasSuffix(to, "/followers") == true {
// This check is very much a bad solution, may consider removing the entire for-loop
continue
}
go check_user(to)
}
}