diff options
Diffstat (limited to 'internal/api')
-rw-r--r-- | internal/api/client/instance/instancepatch_test.go | 30 | ||||
-rw-r--r-- | internal/api/model/status.go | 9 |
2 files changed, 33 insertions, 6 deletions
diff --git a/internal/api/client/instance/instancepatch_test.go b/internal/api/client/instance/instancepatch_test.go index 2fc045855..1f8b691be 100644 --- a/internal/api/client/instance/instancepatch_test.go +++ b/internal/api/client/instance/instancepatch_test.go @@ -82,7 +82,10 @@ func (suite *InstancePatchTestSuite) TestInstancePatch1() { "short_description": "\u003cp\u003eThis is the GoToSocial testrig. It doesn't federate or anything.\u003c/p\u003e\u003cp\u003eWhen the testrig is shut down, all data on it will be deleted.\u003c/p\u003e\u003cp\u003eDon't use this in production!\u003c/p\u003e", "email": "someone@example.org", "version": "0.0.0-testrig", - "languages": [], + "languages": [ + "nl", + "en-gb" + ], "registrations": true, "approval_required": true, "invites_enabled": false, @@ -196,7 +199,10 @@ func (suite *InstancePatchTestSuite) TestInstancePatch2() { "short_description": "\u003cp\u003eThis is the GoToSocial testrig. It doesn't federate or anything.\u003c/p\u003e\u003cp\u003eWhen the testrig is shut down, all data on it will be deleted.\u003c/p\u003e\u003cp\u003eDon't use this in production!\u003c/p\u003e", "email": "admin@example.org", "version": "0.0.0-testrig", - "languages": [], + "languages": [ + "nl", + "en-gb" + ], "registrations": true, "approval_required": true, "invites_enabled": false, @@ -310,7 +316,10 @@ func (suite *InstancePatchTestSuite) TestInstancePatch3() { "short_description": "\u003cp\u003eThis is some html, which is \u003cem\u003eallowed\u003c/em\u003e in short descriptions.\u003c/p\u003e", "email": "admin@example.org", "version": "0.0.0-testrig", - "languages": [], + "languages": [ + "nl", + "en-gb" + ], "registrations": true, "approval_required": true, "invites_enabled": false, @@ -475,7 +484,10 @@ func (suite *InstancePatchTestSuite) TestInstancePatch6() { "short_description": "\u003cp\u003eThis is the GoToSocial testrig. It doesn't federate or anything.\u003c/p\u003e\u003cp\u003eWhen the testrig is shut down, all data on it will be deleted.\u003c/p\u003e\u003cp\u003eDon't use this in production!\u003c/p\u003e", "email": "", "version": "0.0.0-testrig", - "languages": [], + "languages": [ + "nl", + "en-gb" + ], "registrations": true, "approval_required": true, "invites_enabled": false, @@ -611,7 +623,10 @@ func (suite *InstancePatchTestSuite) TestInstancePatch8() { "short_description": "\u003cp\u003eThis is the GoToSocial testrig. It doesn't federate or anything.\u003c/p\u003e\u003cp\u003eWhen the testrig is shut down, all data on it will be deleted.\u003c/p\u003e\u003cp\u003eDon't use this in production!\u003c/p\u003e", "email": "admin@example.org", "version": "0.0.0-testrig", - "languages": [], + "languages": [ + "nl", + "en-gb" + ], "registrations": true, "approval_required": true, "invites_enabled": false, @@ -762,7 +777,10 @@ func (suite *InstancePatchTestSuite) TestInstancePatch9() { "short_description": "\u003cp\u003eThis is the GoToSocial testrig. It doesn't federate or anything.\u003c/p\u003e\u003cp\u003eWhen the testrig is shut down, all data on it will be deleted.\u003c/p\u003e\u003cp\u003eDon't use this in production!\u003c/p\u003e", "email": "admin@example.org", "version": "0.0.0-testrig", - "languages": [], + "languages": [ + "nl", + "en-gb" + ], "registrations": true, "approval_required": true, "invites_enabled": false, diff --git a/internal/api/model/status.go b/internal/api/model/status.go index a6c7f43a4..1efae9cfc 100644 --- a/internal/api/model/status.go +++ b/internal/api/model/status.go @@ -17,6 +17,8 @@ package model +import "github.com/superseriousbusiness/gotosocial/internal/language" + // Status models a status or post. // // swagger:model status @@ -98,6 +100,13 @@ type Status struct { // so the user may redraft from the source text without the client having to reverse-engineer // the original text from the HTML content. Text string `json:"text,omitempty"` + + // Additional fields not exposed via JSON + // (used only internally for templating etc). + + // Template-ready language tag + string, based + // on *status.Language. Nil for non-web statuses + LanguageTag *language.Language `json:"-"` } /* |