mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-24 09:20:59 +00:00
[bugfix] Don't nil emojis + fields on blocked accounts (#2968)
* [bugfix] Don't nil emojis + fields on blocked accounts * comment * swagger
This commit is contained in:
parent
3b7faac604
commit
6f26b32ec3
4 changed files with 14 additions and 4 deletions
|
@ -223,7 +223,9 @@ definitions:
|
||||||
type: string
|
type: string
|
||||||
x-go-name: DisplayName
|
x-go-name: DisplayName
|
||||||
emojis:
|
emojis:
|
||||||
description: Array of custom emojis used in this account's note or display name.
|
description: |-
|
||||||
|
Array of custom emojis used in this account's note or display name.
|
||||||
|
Empty for blocked accounts.
|
||||||
items:
|
items:
|
||||||
$ref: '#/definitions/emoji'
|
$ref: '#/definitions/emoji'
|
||||||
type: array
|
type: array
|
||||||
|
@ -235,7 +237,9 @@ definitions:
|
||||||
type: boolean
|
type: boolean
|
||||||
x-go-name: EnableRSS
|
x-go-name: EnableRSS
|
||||||
fields:
|
fields:
|
||||||
description: Additional metadata attached to this account's profile.
|
description: |-
|
||||||
|
Additional metadata attached to this account's profile.
|
||||||
|
Empty for blocked accounts.
|
||||||
items:
|
items:
|
||||||
$ref: '#/definitions/field'
|
$ref: '#/definitions/field'
|
||||||
type: array
|
type: array
|
||||||
|
|
|
@ -79,8 +79,10 @@ type Account struct {
|
||||||
// example: 2021-07-30T09:20:25+00:00
|
// example: 2021-07-30T09:20:25+00:00
|
||||||
LastStatusAt *string `json:"last_status_at"`
|
LastStatusAt *string `json:"last_status_at"`
|
||||||
// Array of custom emojis used in this account's note or display name.
|
// Array of custom emojis used in this account's note or display name.
|
||||||
|
// Empty for blocked accounts.
|
||||||
Emojis []Emoji `json:"emojis"`
|
Emojis []Emoji `json:"emojis"`
|
||||||
// Additional metadata attached to this account's profile.
|
// Additional metadata attached to this account's profile.
|
||||||
|
// Empty for blocked accounts.
|
||||||
Fields []Field `json:"fields"`
|
Fields []Field `json:"fields"`
|
||||||
// Account has been suspended by our instance.
|
// Account has been suspended by our instance.
|
||||||
Suspended bool `json:"suspended,omitempty"`
|
Suspended bool `json:"suspended,omitempty"`
|
||||||
|
|
|
@ -368,6 +368,10 @@ func (c *Converter) AccountToAPIAccountBlocked(ctx context.Context, a *gtsmodel.
|
||||||
Bot: *a.Bot,
|
Bot: *a.Bot,
|
||||||
CreatedAt: util.FormatISO8601(a.CreatedAt),
|
CreatedAt: util.FormatISO8601(a.CreatedAt),
|
||||||
URL: a.URL,
|
URL: a.URL,
|
||||||
|
// Empty array (not nillable).
|
||||||
|
Emojis: make([]apimodel.Emoji, 0),
|
||||||
|
// Empty array (not nillable).
|
||||||
|
Fields: make([]apimodel.Field, 0),
|
||||||
Suspended: !a.SuspendedAt.IsZero(),
|
Suspended: !a.SuspendedAt.IsZero(),
|
||||||
Role: role,
|
Role: role,
|
||||||
}
|
}
|
||||||
|
|
|
@ -420,8 +420,8 @@ func (suite *InternalToFrontendTestSuite) TestLocalInstanceAccountToFrontendBloc
|
||||||
"following_count": 0,
|
"following_count": 0,
|
||||||
"statuses_count": 0,
|
"statuses_count": 0,
|
||||||
"last_status_at": null,
|
"last_status_at": null,
|
||||||
"emojis": null,
|
"emojis": [],
|
||||||
"fields": null
|
"fields": []
|
||||||
}`, string(b))
|
}`, string(b))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue