summaryrefslogtreecommitdiff
path: root/internal/api/model
diff options
context:
space:
mode:
authorLibravatar nicole mikołajczyk <git@mkljczk.pl>2025-06-09 12:32:14 +0200
committerLibravatar tobi <kipvandenbos@noreply.codeberg.org>2025-06-09 12:32:14 +0200
commit01e376526863a17d1f5bae72fd7693afa215291a (patch)
tree1ccc545788a6bf98382e2e99ceb94112547d7a80 /internal/api/model
parent[bugfix] Update `GetURL` to extract url from Link objects with href (#4249) (diff)
downloadgotosocial-01e376526863a17d1f5bae72fd7693afa215291a.tar.xz
[feature] Add fields introduced in Mastodon 4.4.0 to `/api/v2/instance` response (#4240)
# Description ## Checklist - [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md). - [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat. - [x] I/we have not leveraged AI to create the proposed changes. - [x] I/we have performed a self-review of added code. - [x] I/we have written code that is legible and maintainable by others. - [ ] I/we have commented the added code, particularly in hard-to-understand areas. - [x] I/we have made any necessary changes to documentation. - [ ] I/we have added tests that cover new code. - [ ] I/we have run tests and they pass locally with the changes. - [x] I/we have run `go fmt ./...` and `golangci-lint run`. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4240 Co-authored-by: nicole mikołajczyk <git@mkljczk.pl> Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
Diffstat (limited to 'internal/api/model')
-rw-r--r--internal/api/model/instancev2.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/api/model/instancev2.go b/internal/api/model/instancev2.go
index 5aad6f015..ba8edac47 100644
--- a/internal/api/model/instancev2.go
+++ b/internal/api/model/instancev2.go
@@ -150,6 +150,15 @@ type InstanceV2URLs struct {
// Websockets address for status and notification streaming.
// example: wss://example.org
Streaming string `json:"streaming"`
+ // Address of the server about page.
+ // example: https://example.org/about
+ About string `json:"about"`
+ // Address of the server privacy policy, if any.
+ // example: https://example.org/about#rules
+ PrivacyPolicy *string `json:"privacy_policy"`
+ // Address of the server current terms of service, if any.
+ // example: https://example.org/about#privacy_policy
+ TermsOfService *string `json:"terms_of_service"`
}
// Hints related to translation.
@@ -199,6 +208,13 @@ type InstanceV2Registrations struct {
// Value will be null if no message is set.
// example: <p>Registrations are currently closed on example.org because of spam bots!</p>
Message *string `json:"message"`
+ // A minimum age required to register, if configured.
+ // Currently not implemented: will always be null.
+ MinAge *int `json:"min_age"`
+ // Whether registrations require the user to provide a reason for joining.
+ // Only applicable when ApprovalRequired is true.
+ // example: true
+ ReasonRequired bool `json:"reason_required"`
}
// Hints related to contacting a representative of the instance.