summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/api/model/account.go2
-rw-r--r--internal/typeutils/internaltofrontend.go4
-rw-r--r--internal/typeutils/internaltofrontend_test.go4
3 files changed, 8 insertions, 2 deletions
diff --git a/internal/api/model/account.go b/internal/api/model/account.go
index de850637e..a2f7b46b6 100644
--- a/internal/api/model/account.go
+++ b/internal/api/model/account.go
@@ -79,8 +79,10 @@ type Account struct {
// example: 2021-07-30T09:20:25+00:00
LastStatusAt *string `json:"last_status_at"`
// Array of custom emojis used in this account's note or display name.
+ // Empty for blocked accounts.
Emojis []Emoji `json:"emojis"`
// Additional metadata attached to this account's profile.
+ // Empty for blocked accounts.
Fields []Field `json:"fields"`
// Account has been suspended by our instance.
Suspended bool `json:"suspended,omitempty"`
diff --git a/internal/typeutils/internaltofrontend.go b/internal/typeutils/internaltofrontend.go
index abe2cfaee..68db61128 100644
--- a/internal/typeutils/internaltofrontend.go
+++ b/internal/typeutils/internaltofrontend.go
@@ -368,6 +368,10 @@ func (c *Converter) AccountToAPIAccountBlocked(ctx context.Context, a *gtsmodel.
Bot: *a.Bot,
CreatedAt: util.FormatISO8601(a.CreatedAt),
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(),
Role: role,
}
diff --git a/internal/typeutils/internaltofrontend_test.go b/internal/typeutils/internaltofrontend_test.go
index 676870c7b..946e38b30 100644
--- a/internal/typeutils/internaltofrontend_test.go
+++ b/internal/typeutils/internaltofrontend_test.go
@@ -420,8 +420,8 @@ func (suite *InternalToFrontendTestSuite) TestLocalInstanceAccountToFrontendBloc
"following_count": 0,
"statuses_count": 0,
"last_status_at": null,
- "emojis": null,
- "fields": null
+ "emojis": [],
+ "fields": []
}`, string(b))
}