summaryrefslogtreecommitdiff
path: root/internal/gtsmodel/account.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-05-09 17:05:35 +0200
committerLibravatar GitHub <noreply@github.com>2023-05-09 16:05:35 +0100
commit878ed48de34365474498365ab11e3a0feb646be3 (patch)
treebeafb33aec0292badf3600aa8cdc9bac71df07d7 /internal/gtsmodel/account.go
parent[bugfix] fix possible domain blockcache nil ptr + add debug String() func (#1... (diff)
downloadgotosocial-878ed48de34365474498365ab11e3a0feb646be3.tar.xz
[bugfix] Don't try to get user when serializing local instance account (#1757)
Diffstat (limited to 'internal/gtsmodel/account.go')
-rw-r--r--internal/gtsmodel/account.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/gtsmodel/account.go b/internal/gtsmodel/account.go
index bae50a749..7956157ff 100644
--- a/internal/gtsmodel/account.go
+++ b/internal/gtsmodel/account.go
@@ -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 == "" ||