diff options
author | 2023-09-23 17:44:11 +0100 | |
---|---|---|
committer | 2023-09-23 18:44:11 +0200 | |
commit | 8f67dd583d86155440e7905ae23083a9fea42f72 (patch) | |
tree | e67abf09a53c2d9053df8072b074a026969d93ef /internal/typeutils/wrap.go | |
parent | [chore] fix typo in slice.go (#2219) (diff) | |
download | gotosocial-8f67dd583d86155440e7905ae23083a9fea42f72.tar.xz |
[chore] deinterface the typeutils.Converter and update to use state structure (#2217)
* update typeconverter to use state structure
* deinterface the typeutils.TypeConverter -> typeutils.Converter
* finish copying over old type converter code comments
* fix cherry-pick merge issues, fix tests pointing to old typeutils interface type still
Diffstat (limited to 'internal/typeutils/wrap.go')
-rw-r--r-- | internal/typeutils/wrap.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/internal/typeutils/wrap.go b/internal/typeutils/wrap.go index 71099cbee..67d3c2b5c 100644 --- a/internal/typeutils/wrap.go +++ b/internal/typeutils/wrap.go @@ -30,7 +30,8 @@ import ( "github.com/superseriousbusiness/gotosocial/internal/uris" ) -func (c *converter) WrapPersonInUpdate(person vocab.ActivityStreamsPerson, originAccount *gtsmodel.Account) (vocab.ActivityStreamsUpdate, error) { +// WrapPersonInUpdate ... +func (c *Converter) WrapPersonInUpdate(person vocab.ActivityStreamsPerson, originAccount *gtsmodel.Account) (vocab.ActivityStreamsUpdate, error) { update := streams.NewActivityStreamsUpdate() // set the actor @@ -84,7 +85,12 @@ func (c *converter) WrapPersonInUpdate(person vocab.ActivityStreamsPerson, origi return update, nil } -func (c *converter) WrapNoteInCreate(note vocab.ActivityStreamsNote, objectIRIOnly bool) (vocab.ActivityStreamsCreate, error) { +// WrapNoteInCreate wraps a Note with a Create activity. +// +// If objectIRIOnly is set to true, then the function won't put the *entire* note in the Object field of the Create, +// but just the AP URI of the note. This is useful in cases where you want to give a remote server something to dereference, +// and still have control over whether or not they're allowed to actually see the contents. +func (c *Converter) WrapNoteInCreate(note vocab.ActivityStreamsNote, objectIRIOnly bool) (vocab.ActivityStreamsCreate, error) { create := streams.NewActivityStreamsCreate() // Object property |