summaryrefslogtreecommitdiff
path: root/internal/federation/federatingdb/util.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-10-24 11:57:39 +0200
committerLibravatar GitHub <noreply@github.com>2021-10-24 11:57:39 +0200
commit4b1d9d3780134098ff06877abc20c970c32d4aac (patch)
treea46deccd4cdf2ddf9d0ea92f32bd8669657a4687 /internal/federation/federatingdb/util.go
parentpregenerate RSA keys for testrig accounts. If a user is added without a key,... (diff)
downloadgotosocial-4b1d9d3780134098ff06877abc20c970c32d4aac.tar.xz
Serve `outbox` for Actor (#289)
* add statusesvisible convenience function * add minID + onlyPublic to account statuses get * move swagger collection stuff to common * start working on Outbox GETting * move functions into federationProcessor * outboxToASCollection * add statusesvisible convenience function * add minID + onlyPublic to account statuses get * move swagger collection stuff to common * start working on Outbox GETting * move functions into federationProcessor * outboxToASCollection * bit more work on outbox paging * wrapNoteInCreate function * test + hook up the processor functions * don't do prev + next links on empty reply * test get outbox through api * don't fail on no status entries * add outbox implementation doc * typo
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 3fd9653af..34a103a49 100644
--- a/internal/federation/federatingdb/util.go
+++ b/internal/federation/federatingdb/util.go
@@ -135,6 +135,19 @@ func (f *federatingDB) NewID(ctx context.Context, t vocab.Type) (idURL *url.URL,
return idProp.GetIRI(), nil
}
}
+ case ap.ActivityCreate:
+ // CREATE
+ // ID might already be set on a Create, so check it here and return it if it is
+ create, ok := t.(vocab.ActivityStreamsCreate)
+ if !ok {
+ return nil, errors.New("newid: create couldn't be parsed into vocab.ActivityStreamsCreate")
+ }
+ idProp := create.GetJSONLDId()
+ if idProp != nil {
+ if idProp.IsIRI() {
+ return idProp.GetIRI(), nil
+ }
+ }
case ap.ActivityAnnounce:
// ANNOUNCE aka BOOST
// ID might already be set on an announce we've created, so check it here and return it if it is