diff options
| author | 2025-05-06 09:58:47 +0000 | |
|---|---|---|
| committer | 2025-05-06 09:58:47 +0000 | |
| commit | cf93d3af0ace59fa618a51537a77f7912e5f1610 (patch) | |
| tree | 196ab23fdac7871a587f929da2265a8b18476c97 /internal/typeutils | |
| parent | [feature] add ability to change s3 bucket lookup type (#4120) (diff) | |
| download | gotosocial-cf93d3af0ace59fa618a51537a77f7912e5f1610.tar.xz | |
[feature] Add `description_limit` to `/api/v2/instance`, increase default limit to 5k (#4140)
Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4131 by adding `description_limit` to the `api/v2/instance` response. Also increases default sizes to default status length to allow people to more easily describe things like screenshots of text.
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4140
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
Diffstat (limited to 'internal/typeutils')
| -rw-r--r-- | internal/typeutils/internaltofrontend.go | 2 | ||||
| -rw-r--r-- | internal/typeutils/internaltofrontend_test.go | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/internal/typeutils/internaltofrontend.go b/internal/typeutils/internaltofrontend.go index 659f47ab4..ffd971040 100644 --- a/internal/typeutils/internaltofrontend.go +++ b/internal/typeutils/internaltofrontend.go @@ -1966,6 +1966,8 @@ func (c *Converter) InstanceToAPIV2Instance(ctx context.Context, i *gtsmodel.Ins instance.Configuration.Statuses.CharactersReservedPerURL = instanceStatusesCharactersReservedPerURL instance.Configuration.Statuses.SupportedMimeTypes = instanceStatusesSupportedMimeTypes instance.Configuration.MediaAttachments.SupportedMimeTypes = media.SupportedMIMETypes + instance.Configuration.MediaAttachments.DescriptionLimit = config.GetMediaDescriptionMaxChars() + instance.Configuration.MediaAttachments.DescriptionMinimum = config.GetMediaDescriptionMinChars() // NOTE: we use the local max sizes here // as it hints to apps like Tusky for image diff --git a/internal/typeutils/internaltofrontend_test.go b/internal/typeutils/internaltofrontend_test.go index f38e815f9..63e242f79 100644 --- a/internal/typeutils/internaltofrontend_test.go +++ b/internal/typeutils/internaltofrontend_test.go @@ -2501,7 +2501,8 @@ func (suite *InternalToFrontendTestSuite) TestInstanceV2ToFrontend() { "image_matrix_limit": 2147483647, "video_size_limit": 41943040, "video_frame_rate_limit": 2147483647, - "video_matrix_limit": 2147483647 + "video_matrix_limit": 2147483647, + "description_limit": 500 }, "polls": { "max_options": 6, |
