gotosocial/internal
ewwwin 424f62dd70
[bugfix] Store and expose status content type (#3870)
* Add ContentType to internal models

* Add ContentType to API models StatusSource and StatusEdit

* Add helpers to convert between API/internal StatusContentType

* Write status content type on create/edit

* Add migration

* Update API docs

go run github.com/go-swagger/go-swagger/cmd/swagger generate spec --scan-models --exclude-deps --output docs/api/swagger.yaml

* ensure ContentType is updated anywhere Text is

* Update docs, take care of TODOs

* Set ContentType in more places where Text is set

* We don't actually use ContentType on the API status model

* Update StatusSource test

* Remove unused helper function I copied

* Revert change to StatusContentType swagger annotation

I'm going to include this in a follow-on PR instead.

* Add test for updating content type in edits

* Return a value from processContentType instead of modifying the existing status

Fixes an issue that was caught by the test I just added - the recorded edit would be marked with the *new* content type instead of the old one, which is obviously bad

* Add test for handling of statuses with no stored content type

* repurpose an existing test status instead of adding a new one to avoid breaking other tests

* Add test to ensure newly created statuses always have content type saved

* Do include content type on status API model actually

This is mostly important when deleting and redrafting.

The comment on `apimodel.Status.Text` implies that it's not sent except in response to status deletion, but actually this doesn't seem to be the case; it also appears to be present in responses to creations and normal fetches and stuff. So I'm treating `ContentType` the same here.

* Update new tests to check content type on API statuses

* Check content type of API statuses in all tests where text is checked

* update other api tests with status content type field

* Add test ensuring text and content type are returned when deleting a status

* Convert processContentType to free function and remove unused parameter

* check for the correct value in the deletion test

* Be explicit about this test status having an empty content type

* Use omitempty consistently on API models

* clean up the final diff a bit

* one more swagger regen for the road

* Handle nil statuses in processContentType

* Don't pass processContentType the entire edit form, it doesn't need it

* Move processContentType to common.go and use for creation as well

* Remove unused parameters to ContentTypeToAPIContentType
2025-03-06 16:31:52 +00:00
..
admin [feature] Fetch + create domain permissions from subscriptions nightly (#3635) 2025-01-08 11:29:40 +01:00
ap [chore] github.com/superseriousbusiness/activity -> codeberg.org/superseriousbusiness/activity (#3853) 2025-03-02 12:48:00 +01:00
api [bugfix] Store and expose status content type (#3870) 2025-03-06 16:31:52 +00:00
cache [bugfix] Store and expose status content type (#3870) 2025-03-06 16:31:52 +00:00
cleaner [bugfix] Missing emoji urls (#3707) 2025-01-30 13:52:03 +01:00
config [bugfix] Return useful err on server start failure (#3879) 2025-03-05 19:12:53 +01:00
db [bugfix] Store and expose status content type (#3870) 2025-03-06 16:31:52 +00:00
email [bugfix/email] Don't use plainAuth when no smtp username/password provided (#3332) 2024-09-23 16:07:13 +02:00
federation [bugfix] Store and expose status content type (#3870) 2025-03-06 16:31:52 +00:00
filter [feature] Refactor tokens, allow multiple app redirect_uris (#3849) 2025-03-03 15:03:36 +00:00
gtscontext [chore] github.com/superseriousbusiness/httpsig -> codeberg.org/superseriousbusiness/httpsig (#3854) 2025-03-02 13:28:38 +01:00
gtserror [chore] remove type switch in Create() and instead move to FederatedCallbacks() (#3697) 2025-01-28 20:22:23 +00:00
gtsmodel [bugfix] Store and expose status content type (#3870) 2025-03-06 16:31:52 +00:00
headerfilter [feature] request blocking by http headers (#2409) 2023-12-18 14:18:25 +00:00
httpclient [chore] some tidy ups (#3677) 2025-01-27 15:54:59 +00:00
id [feature] Create/update/remove domain permission subscriptions (#3623) 2025-01-05 13:20:33 +01:00
iotools [performance] update storage backend and make use of seek syscall when available (#2924) 2024-05-22 11:46:24 +02:00
language [feature] Set/show instance language(s); show post language on frontend (#2362) 2023-11-17 11:35:28 +01:00
log [performance] minimise log field allocations (#3529) 2024-11-11 15:45:19 +00:00
media temporary fix for tetratelabs/wazero#2365 armv8 compiler support bug (#3741) 2025-02-06 12:44:40 +00:00
messages [chore] github.com/superseriousbusiness/activity -> codeberg.org/superseriousbusiness/activity (#3853) 2025-03-02 12:48:00 +01:00
middleware [chore] migrate oauth2 -> codeberg (#3857) 2025-03-02 16:42:51 +01:00
oauth [feature] Refactor tokens, allow multiple app redirect_uris (#3849) 2025-03-03 15:03:36 +00:00
observability [chore] update otel libraries (#3740) 2025-02-06 12:14:37 +01:00
oidc [chore] Improve copyright header handling (#1608) 2023-03-12 16:00:57 +01:00
paging [bugfix] flaky paging test (#2888) 2024-05-01 13:29:42 +02:00
processing [bugfix] Store and expose status content type (#3870) 2025-03-06 16:31:52 +00:00
queue [performance] update go-structr and go-mutexes with memory usage improvements (#2909) 2024-05-13 08:05:46 +00:00
regexes [feature] Allow emoji shortcode to be 1-character length (#3556) 2024-11-21 12:13:55 +01:00
router [chore] little frontend tweaks (#3852) 2025-03-02 11:27:30 +01:00
scheduler [feature] add support for polls + receiving federated status edits (#2330) 2023-11-08 14:32:17 +00:00
state [feature] Fetch + create domain permissions from subscriptions nightly (#3635) 2025-01-08 11:29:40 +01:00
storage [bugfix] s3 media uploaded without content-type (#3353) 2024-09-26 14:43:10 +02:00
stream [feature] Conversations API (#3013) 2024-07-23 20:44:31 +01:00
subscriptions [bugfix] Store LastModified for domain perm subs + send as If-Modified-Since (#3655) 2025-01-20 10:56:00 +01:00
text [feature] Refactor tokens, allow multiple app redirect_uris (#3849) 2025-03-03 15:03:36 +00:00
timeline [feature] add support for receiving federated status edits (#3597) 2024-12-05 13:35:07 +00:00
trans [feature] Allow users to export data via the settings panel (#3140) 2024-07-31 15:03:34 +01:00
transport [bugfix] Return useful err on server start failure (#3879) 2025-03-05 19:12:53 +01:00
typeutils [bugfix] Store and expose status content type (#3870) 2025-03-06 16:31:52 +00:00
uris [feature] Interaction requests client api + settings panel (#3215) 2024-08-24 11:49:37 +02:00
util [chore] better dns validation (#3644) 2025-01-14 14:23:18 +00:00
validate [feature] Add global instance CSS customization setting (#3352) 2024-12-02 12:24:48 +01:00
web [feature] Add page-specific class per template (#3814) 2025-02-20 15:09:28 +01:00
webpush [feature] Refactor tokens, allow multiple app redirect_uris (#3849) 2025-03-03 15:03:36 +00:00
workers [feature] Push notifications (#3587) 2025-01-23 16:47:30 -08:00