diff options
author | 2021-08-20 12:26:56 +0200 | |
---|---|---|
committer | 2021-08-20 12:26:56 +0200 | |
commit | 4920229a3b6e1d7dde536bc9ff766542b05d935c (patch) | |
tree | a9423beccec5331c372f01eedf38949dfb171e9e /internal/processing/status/create.go | |
parent | Text/status parsing fixes (#141) (diff) | |
download | gotosocial-4920229a3b6e1d7dde536bc9ff766542b05d935c.tar.xz |
Database updates (#144)
* start moving some database stuff around
* continue moving db stuff around
* more fiddling
* more updates
* and some more
* and yet more
* i broke SOMETHING but what, it's a mystery
* tidy up
* vendor ttlcache
* use ttlcache
* fix up some tests
* rename some stuff
* little reminder
* some more updates
Diffstat (limited to 'internal/processing/status/create.go')
-rw-r--r-- | internal/processing/status/create.go | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/internal/processing/status/create.go b/internal/processing/status/create.go index 0e99b5f4a..fc112ed8b 100644 --- a/internal/processing/status/create.go +++ b/internal/processing/status/create.go @@ -38,27 +38,22 @@ func (p *processor) Create(account *gtsmodel.Account, application *gtsmodel.Appl Text: form.Status, } - // check if replyToID is ok if err := p.ProcessReplyToID(form, account.ID, newStatus); err != nil { return nil, gtserror.NewErrorInternalError(err) } - // check if mediaIDs are ok if err := p.ProcessMediaIDs(form, account.ID, newStatus); err != nil { return nil, gtserror.NewErrorInternalError(err) } - // check if visibility settings are ok if err := p.ProcessVisibility(form, account.Privacy, newStatus); err != nil { return nil, gtserror.NewErrorInternalError(err) } - // handle language settings if err := p.ProcessLanguage(form, account.Language, newStatus); err != nil { return nil, gtserror.NewErrorInternalError(err) } - // handle mentions if err := p.ProcessMentions(form, account.ID, newStatus); err != nil { return nil, gtserror.NewErrorInternalError(err) } @@ -75,20 +70,11 @@ func (p *processor) Create(account *gtsmodel.Account, application *gtsmodel.Appl return nil, gtserror.NewErrorInternalError(err) } - // put the new status in the database, generating an ID for it in the process - if err := p.db.Put(newStatus); err != nil { + // put the new status in the database + if err := p.db.PutStatus(newStatus); err != nil { return nil, gtserror.NewErrorInternalError(err) } - // change the status ID of the media attachments to the new status - for _, a := range newStatus.GTSMediaAttachments { - a.StatusID = newStatus.ID - a.UpdatedAt = time.Now() - if err := p.db.UpdateByID(a.ID, a); err != nil { - return nil, gtserror.NewErrorInternalError(err) - } - } - // send it back to the processor for async processing p.fromClientAPI <- gtsmodel.FromClientAPI{ APObjectType: gtsmodel.ActivityStreamsNote, |