diff options
Diffstat (limited to 'internal/processing/status')
-rw-r--r-- | internal/processing/status/create.go | 7 | ||||
-rw-r--r-- | internal/processing/status/fave.go | 2 | ||||
-rw-r--r-- | internal/processing/status/util.go | 10 |
3 files changed, 11 insertions, 8 deletions
diff --git a/internal/processing/status/create.go b/internal/processing/status/create.go index 2c509809a..fef857c7c 100644 --- a/internal/processing/status/create.go +++ b/internal/processing/status/create.go @@ -40,18 +40,21 @@ func (p *processor) Create(ctx context.Context, account *gtsmodel.Account, appli return nil, gtserror.NewErrorInternalError(err) } + local := true + sensitive := form.Sensitive + newStatus := >smodel.Status{ ID: thisStatusID, URI: accountURIs.StatusesURI + "/" + thisStatusID, URL: accountURIs.StatusesURL + "/" + thisStatusID, CreatedAt: time.Now(), UpdatedAt: time.Now(), - Local: true, + Local: &local, AccountID: account.ID, AccountURI: account.URI, ContentWarning: text.SanitizePlaintext(form.SpoilerText), ActivityStreamsType: ap.ObjectNote, - Sensitive: form.Sensitive, + Sensitive: &sensitive, Language: form.Language, CreatedWithApplicationID: application.ID, Text: form.Status, diff --git a/internal/processing/status/fave.go b/internal/processing/status/fave.go index 1b40d9da1..f80d65358 100644 --- a/internal/processing/status/fave.go +++ b/internal/processing/status/fave.go @@ -49,7 +49,7 @@ func (p *processor) Fave(ctx context.Context, requestingAccount *gtsmodel.Accoun if !visible { return nil, gtserror.NewErrorNotFound(errors.New("status is not visible")) } - if !targetStatus.Likeable { + if !*targetStatus.Likeable { return nil, gtserror.NewErrorForbidden(errors.New("status is not faveable")) } diff --git a/internal/processing/status/util.go b/internal/processing/status/util.go index 64b496673..5e961e2ea 100644 --- a/internal/processing/status/util.go +++ b/internal/processing/status/util.go @@ -98,10 +98,10 @@ func (p *processor) ProcessVisibility(ctx context.Context, form *apimodel.Advanc } status.Visibility = vis - status.Federated = federated - status.Boostable = boostable - status.Replyable = replyable - status.Likeable = likeable + status.Federated = &federated + status.Boostable = &boostable + status.Replyable = &replyable + status.Likeable = &likeable return nil } @@ -128,7 +128,7 @@ func (p *processor) ProcessReplyToID(ctx context.Context, form *apimodel.Advance err := fmt.Errorf("db error fetching status with id %s: %s", form.InReplyToID, err) return gtserror.NewErrorInternalError(err) } - if !repliedStatus.Replyable { + if !*repliedStatus.Replyable { err := fmt.Errorf("status with id %s is marked as not replyable", form.InReplyToID) return gtserror.NewErrorForbidden(err, err.Error()) } |