diff options
| author | 2025-04-04 18:29:22 +0200 | |
|---|---|---|
| committer | 2025-04-04 18:29:22 +0200 | |
| commit | b1844323314dd1f0832f1fcdb765a7f67ca01dbc (patch) | |
| tree | e568a5941a6155e9ca55f3e4194b3256ad2fe352 /internal/api/model | |
| parent | [chore] bump ncruces/go-sqlite3 to v0.25.0 (#3966) (diff) | |
| download | gotosocial-b1844323314dd1f0832f1fcdb765a7f67ca01dbc.tar.xz | |
[feature] Allow editing domain blocks/allows, fix comment import (#3967)
* start implementing editing of existing domain permissions
* [feature] Allow editing domain blocks/allows, fix comment import
* [bugfix] Use "comment" via /api/v1/instance
* fix the stuff
Diffstat (limited to 'internal/api/model')
| -rw-r--r-- | internal/api/model/domain.go | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/internal/api/model/domain.go b/internal/api/model/domain.go index 94a190f63..8d94321d0 100644 --- a/internal/api/model/domain.go +++ b/internal/api/model/domain.go @@ -33,8 +33,13 @@ type Domain struct { // example: 2021-07-30T09:20:25+00:00 SilencedAt string `json:"silenced_at,omitempty"` // If the domain is blocked, what's the publicly-stated reason for the block. + // Alternative to `public_comment` to be used when serializing/deserializing via /api/v1/instance. // example: they smell - PublicComment string `form:"public_comment" json:"public_comment,omitempty"` + Comment *string `form:"comment" json:"comment,omitempty"` + // If the domain is blocked, what's the publicly-stated reason for the block. + // Alternative to `comment` to be used when serializing/deserializing NOT via /api/v1/instance. + // example: they smell + PublicComment *string `form:"public_comment" json:"public_comment,omitempty"` } // DomainPermission represents a permission applied to one domain (explicit block/allow). @@ -48,10 +53,10 @@ type DomainPermission struct { ID string `json:"id,omitempty"` // Obfuscate the domain name when serving this domain permission entry publicly. // example: false - Obfuscate bool `json:"obfuscate,omitempty"` + Obfuscate *bool `json:"obfuscate,omitempty"` // Private comment for this permission entry, visible to this instance's admins only. // example: they are poopoo - PrivateComment string `json:"private_comment,omitempty"` + PrivateComment *string `json:"private_comment,omitempty"` // If applicable, the ID of the subscription that caused this domain permission entry to be created. // example: 01FBW25TF5J67JW3HFHZCSD23K SubscriptionID string `json:"subscription_id,omitempty"` @@ -80,14 +85,14 @@ type DomainPermissionRequest struct { // Obfuscate the domain name when displaying this permission entry publicly. // Ie., instead of 'example.org' show something like 'e**mpl*.or*'. // example: false - Obfuscate bool `form:"obfuscate" json:"obfuscate"` + Obfuscate *bool `form:"obfuscate" json:"obfuscate"` // Private comment for other admins on why this permission entry was created. // example: don't like 'em!!!! - PrivateComment string `form:"private_comment" json:"private_comment"` + PrivateComment *string `form:"private_comment" json:"private_comment"` // Public comment on why this permission entry was created. // Will be visible to requesters at /api/v1/instance/peers if this endpoint is exposed. // example: foss dorks 😫 - PublicComment string `form:"public_comment" json:"public_comment"` + PublicComment *string `form:"public_comment" json:"public_comment"` // Permission type to create (only applies to domain permission drafts, not explicit blocks and allows). PermissionType string `form:"permission_type" json:"permission_type"` } |
