summaryrefslogtreecommitdiff
path: root/internal/federation/federatingdb/util.go
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-05-28 19:57:04 +0200
committerLibravatar GitHub <noreply@github.com>2021-05-28 19:57:04 +0200
commit87177d840b9703f572392ef4bd0f5013fd5c3a77 (patch)
treec59388998d5defd5ec3577483f70736238953f72 /internal/federation/federatingdb/util.go
parentNotifications (#34) (diff)
downloadgotosocial-87177d840b9703f572392ef4bd0f5013fd5c3a77.tar.xz
Announce/boost (#35)
Remote boosts incoming/outgoing now working.
Diffstat (limited to 'internal/federation/federatingdb/util.go')
-rw-r--r--internal/federation/federatingdb/util.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/federation/federatingdb/util.go b/internal/federation/federatingdb/util.go
index be3cff944..53fe194a7 100644
--- a/internal/federation/federatingdb/util.go
+++ b/internal/federation/federatingdb/util.go
@@ -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