summaryrefslogtreecommitdiff
path: root/internal/api/client/statuses/statuscreate.go
diff options
context:
space:
mode:
authorLibravatar Vyr Cossont <VyrCossont@users.noreply.github.com>2025-02-12 09:49:33 -0800
committerLibravatar GitHub <noreply@github.com>2025-02-12 09:49:33 -0800
commitfccb0bc102f2a54a21eed343cda64f9a5221b677 (patch)
treeb7c1858f4a92841dfaf59e7102189a635d7136f8 /internal/api/client/statuses/statuscreate.go
parent[performance] improved enum migrations (#3782) (diff)
downloadgotosocial-fccb0bc102f2a54a21eed343cda64f9a5221b677.tar.xz
[feature] Implement backfilling statuses thru scheduled_at (#3685)
* Implement backfilling statuses thru scheduled_at * Forbid mentioning others in backfills * Update error messages & codes * Add new tests for backfilled statuses * Test that backfilling doesn't timeline or notify * Fix check for absence of notification * Test that backfills do not cause federation * Fix type of apimodel.StatusCreateRequest.ScheduledAt in tests * Add config file switch and min date check
Diffstat (limited to 'internal/api/client/statuses/statuscreate.go')
-rw-r--r--internal/api/client/statuses/statuscreate.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/internal/api/client/statuses/statuscreate.go b/internal/api/client/statuses/statuscreate.go
index d187e823f..bfb1c486d 100644
--- a/internal/api/client/statuses/statuscreate.go
+++ b/internal/api/client/statuses/statuscreate.go
@@ -179,11 +179,15 @@ import (
// x-go-name: ScheduledAt
// description: |-
// ISO 8601 Datetime at which to schedule a status.
-// Providing this parameter will cause ScheduledStatus to be returned instead of Status.
+//
+// Providing this parameter with a *future* time will cause ScheduledStatus to be returned instead of Status.
// Must be at least 5 minutes in the future.
+// This feature isn't implemented yet.
//
-// This feature isn't implemented yet; attemping to set it will return 501 Not Implemented.
+// Providing this parameter with a *past* time will cause the status to be backdated,
+// and will not push it to the user's followers. This is intended for importing old statuses.
// type: string
+// format: date-time
// in: formData
// -
// name: language
@@ -384,12 +388,6 @@ func parseStatusCreateForm(c *gin.Context) (*apimodel.StatusCreateRequest, gtser
return nil, gtserror.NewErrorNotAcceptable(errors.New(text), text)
}
- // Check not scheduled status.
- if form.ScheduledAt != "" {
- const text = "scheduled_at is not yet implemented"
- return nil, gtserror.NewErrorNotImplemented(errors.New(text), text)
- }
-
// Check if the deprecated "federated" field was
// set in lieu of "local_only", and use it if so.
if form.LocalOnly == nil && form.Federated != nil { // nolint:staticcheck