jlelse
/
jsonpub
Archived
1
Fork 0

Announce article if it contains "inReplyTo"

This commit is contained in:
Jan-Lukas Else 2020-03-13 08:30:39 +01:00
parent 0db4c4f6b6
commit 447ce3702c
1 changed files with 12 additions and 0 deletions

View File

@ -139,6 +139,18 @@ func (a *Actor) PostArticle(url string) error {
}
create["object"] = article
go a.sendToFollowers(create)
if article["inReplyTo"] != nil {
// Boost article if it contains "inReplyTo"
announce := make(map[string]interface{})
announce["@context"] = context()
announce["id"] = url + "#Announce"
announce["type"] = "Announce"
announce["object"] = url
announce["actor"] = a.iri
announce["to"] = []string{"https://www.w3.org/ns/activitystreams#Public"}
announce["published"] = article["published"]
go a.sendToFollowers(announce)
}
return nil
}