Announce/boost (#35)

Remote boosts incoming/outgoing now working.
This commit is contained in:
Tobi Smethurst 2021-05-28 19:57:04 +02:00 committed by GitHub
commit 87177d840b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 561 additions and 39 deletions

View file

@ -130,6 +130,19 @@ func (f *federatingDB) NewID(c context.Context, t vocab.Type) (id *url.URL, err
return idProp.GetIRI(), nil
}
}
case gtsmodel.ActivityStreamsAnnounce:
// ANNOUNCE aka BOOST
// ID might already be set on an announce we've created, so check it here and return it if it is
announce, ok := t.(vocab.ActivityStreamsAnnounce)
if !ok {
return nil, errors.New("newid: fave couldn't be parsed into vocab.ActivityStreamsAnnounce")
}
idProp := announce.GetJSONLDId()
if idProp != nil {
if idProp.IsIRI() {
return idProp.GetIRI(), nil
}
}
}
// fallback default behavior: just return a random UUID after our protocol and host