[bugfix] Don't try to get user when serializing local instance account (#1757)

This commit is contained in:
tobi 2023-05-09 17:05:35 +02:00 committed by GitHub
commit 878ed48de3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 139 additions and 29 deletions

View file

@ -95,6 +95,12 @@ func (a *Account) IsRemote() bool {
// IsInstance returns whether account is an instance internal actor account.
func (a *Account) IsInstance() bool {
if a.IsLocal() {
// Check if our instance account.
return a.Username == config.GetHost()
}
// Check if remote instance account.
return a.Username == a.Domain ||
a.FollowersURI == "" ||
a.FollowingURI == "" ||