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 <admin@oldschoolhack.me>
This commit is contained in:
Lunny Xiao 2023-01-01 20:19:23 +08:00 committed by GitHub
parent 2bbf9e7302
commit 9c8fc7f677
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -266,7 +266,7 @@ func Init() error {
enableFederatedAvatar = false enableFederatedAvatar = false
} }
if disableGravatar || !enableFederatedAvatar { if enableFederatedAvatar || !disableGravatar {
var err error var err error
GravatarSourceURL, err = url.Parse(setting.GravatarSource) GravatarSourceURL, err = url.Parse(setting.GravatarSource)
if err != nil { if err != nil {

View file

@ -68,7 +68,7 @@ func newPictureService() {
} }
func GetDefaultDisableGravatar() bool { func GetDefaultDisableGravatar() bool {
return !OfflineMode return OfflineMode
} }
func GetDefaultEnableFederatedAvatar(disableGravatar bool) bool { func GetDefaultEnableFederatedAvatar(disableGravatar bool) bool {