diff options
| author | 2025-05-06 09:58:47 +0000 | |
|---|---|---|
| committer | 2025-05-06 12:07:39 +0200 | |
| commit | 95554220f3286d20f0b65c2ce98fbcf4e9993b4d (patch) | |
| tree | 4c6f2dfb31fc5a02aafadb9b4cf344558746bfcc /internal/typeutils | |
| parent | [feature] add ability to change s3 bucket lookup type (#4120) (diff) | |
| download | gotosocial-95554220f3286d20f0b65c2ce98fbcf4e9993b4d.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 c44ad7c5a..f5f8ae7ec 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, |
