mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-10-31 22:40:01 +00:00
[bugfix] serialize instance terms via API (#2293)
This commit is contained in:
parent
8a23ce2b3e
commit
1e632dc411
3 changed files with 6 additions and 0 deletions
|
@ -90,6 +90,8 @@ type InstanceV1 struct {
|
||||||
MaxTootChars uint `json:"max_toot_chars"`
|
MaxTootChars uint `json:"max_toot_chars"`
|
||||||
// An itemized list of rules for this instance.
|
// An itemized list of rules for this instance.
|
||||||
Rules []InstanceRule `json:"rules"`
|
Rules []InstanceRule `json:"rules"`
|
||||||
|
// Terms and conditions for accounts on this instance.
|
||||||
|
Terms string `json:"terms,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// InstanceV1URLs models instance-relevant URLs for client application consumption.
|
// InstanceV1URLs models instance-relevant URLs for client application consumption.
|
||||||
|
|
|
@ -64,6 +64,8 @@ type InstanceV2 struct {
|
||||||
Contact InstanceV2Contact `json:"contact"`
|
Contact InstanceV2Contact `json:"contact"`
|
||||||
// An itemized list of rules for this instance.
|
// An itemized list of rules for this instance.
|
||||||
Rules []InstanceRule `json:"rules"`
|
Rules []InstanceRule `json:"rules"`
|
||||||
|
// Terms and conditions for accounts on this instance.
|
||||||
|
Terms string `json:"terms,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Usage data for this instance.
|
// Usage data for this instance.
|
||||||
|
|
|
@ -805,6 +805,7 @@ func (c *Converter) InstanceToAPIV1Instance(ctx context.Context, i *gtsmodel.Ins
|
||||||
InvitesEnabled: false, // todo: not supported yet
|
InvitesEnabled: false, // todo: not supported yet
|
||||||
MaxTootChars: uint(config.GetStatusesMaxChars()),
|
MaxTootChars: uint(config.GetStatusesMaxChars()),
|
||||||
Rules: c.InstanceRulesToAPIRules(i.Rules),
|
Rules: c.InstanceRulesToAPIRules(i.Rules),
|
||||||
|
Terms: i.Terms,
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.GetInstanceInjectMastodonVersion() {
|
if config.GetInstanceInjectMastodonVersion() {
|
||||||
|
@ -909,6 +910,7 @@ func (c *Converter) InstanceToAPIV2Instance(ctx context.Context, i *gtsmodel.Ins
|
||||||
Usage: apimodel.InstanceV2Usage{}, // todo: not implemented
|
Usage: apimodel.InstanceV2Usage{}, // todo: not implemented
|
||||||
Languages: []string{}, // todo: not implemented
|
Languages: []string{}, // todo: not implemented
|
||||||
Rules: c.InstanceRulesToAPIRules(i.Rules),
|
Rules: c.InstanceRulesToAPIRules(i.Rules),
|
||||||
|
Terms: i.Terms,
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.GetInstanceInjectMastodonVersion() {
|
if config.GetInstanceInjectMastodonVersion() {
|
||||||
|
|
Loading…
Reference in a new issue