From 9c8fc7f6773c71019365a0bb66f6686ba7420fb8 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 1 Jan 2023 20:19:23 +0800 Subject: [PATCH] Fix bug of DisableGravatar default value (#22296) #18058 made a mistake. The disableGravatar's default value depends on `OfflineMode`. If it's `true`, then `disableGravatar` is true, otherwise it's `false`. But not opposite. Co-authored-by: KN4CK3R --- models/system/setting.go | 2 +- modules/setting/picture.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/system/setting.go b/models/system/setting.go index dc6145b41..6f333d6fd 100644 --- a/models/system/setting.go +++ b/models/system/setting.go @@ -266,7 +266,7 @@ func Init() error { enableFederatedAvatar = false } - if disableGravatar || !enableFederatedAvatar { + if enableFederatedAvatar || !disableGravatar { var err error GravatarSourceURL, err = url.Parse(setting.GravatarSource) if err != nil { diff --git a/modules/setting/picture.go b/modules/setting/picture.go index 9d16a2360..a814af822 100644 --- a/modules/setting/picture.go +++ b/modules/setting/picture.go @@ -68,7 +68,7 @@ func newPictureService() { } func GetDefaultDisableGravatar() bool { - return !OfflineMode + return OfflineMode } func GetDefaultEnableFederatedAvatar(disableGravatar bool) bool {