diff options
author | 2021-05-28 22:47:18 +0200 | |
---|---|---|
committer | 2021-05-28 22:47:18 +0200 | |
commit | cb54324430e7c4640a7aa5aac24932b5e91b71c4 (patch) | |
tree | a5193ee09656d808f589de20f77a5a455a5a6683 /internal/federation/federatingdb/util.go | |
parent | Announce/boost (#35) (diff) | |
download | gotosocial-cb54324430e7c4640a7aa5aac24932b5e91b71c4.tar.xz |
federate account updates
Diffstat (limited to 'internal/federation/federatingdb/util.go')
-rw-r--r-- | internal/federation/federatingdb/util.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/federation/federatingdb/util.go b/internal/federation/federatingdb/util.go index 53fe194a7..ff6ae50a6 100644 --- a/internal/federation/federatingdb/util.go +++ b/internal/federation/federatingdb/util.go @@ -143,6 +143,19 @@ func (f *federatingDB) NewID(c context.Context, t vocab.Type) (id *url.URL, err return idProp.GetIRI(), nil } } + case gtsmodel.ActivityStreamsUpdate: + // UPDATE + // ID might already be set on an update we've created, so check it here and return it if it is + update, ok := t.(vocab.ActivityStreamsUpdate) + if !ok { + return nil, errors.New("newid: fave couldn't be parsed into vocab.ActivityStreamsUpdate") + } + idProp := update.GetJSONLDId() + if idProp != nil { + if idProp.IsIRI() { + return idProp.GetIRI(), nil + } + } } // fallback default behavior: just return a random UUID after our protocol and host |