mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 08:02:26 -05:00
[feature] Change instance-stats-randomize to instance-stats-mode with multiple options; implement nodeinfo 2.1 (#3734)
* [feature] Change `instance-stats-randomize` to `instance-stats-mode` with multiple options; implement nodeinfo 2.1 * swaggalaggadingdong
This commit is contained in:
parent
e1781ff52e
commit
07d2770995
18 changed files with 283 additions and 77 deletions
|
|
@ -1745,9 +1745,9 @@ func (c *Converter) InstanceToAPIV1Instance(ctx context.Context, i *gtsmodel.Ins
|
|||
stats["domain_count"] = util.Ptr(domainCount)
|
||||
instance.Stats = stats
|
||||
|
||||
if config.GetInstanceStatsRandomize() {
|
||||
// Whack some random stats on the instance
|
||||
// to be injected by API handlers.
|
||||
if config.GetInstanceStatsMode() == config.InstanceStatsModeBaffle {
|
||||
// Whack random stats on the instance to be used
|
||||
// by handlers in internal/api/client/instance.
|
||||
instance.RandomStats = c.RandomStats()
|
||||
}
|
||||
|
||||
|
|
@ -1827,9 +1827,9 @@ func (c *Converter) InstanceToAPIV2Instance(ctx context.Context, i *gtsmodel.Ins
|
|||
instance.Debug = util.Ptr(true)
|
||||
}
|
||||
|
||||
if config.GetInstanceStatsRandomize() {
|
||||
// Whack some random stats on the instance
|
||||
// to be injected by API handlers.
|
||||
if config.GetInstanceStatsMode() == config.InstanceStatsModeBaffle {
|
||||
// Whack random stats on the instance to be used
|
||||
// by handlers in internal/api/client/instance.
|
||||
instance.RandomStats = c.RandomStats()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue