|
@@ -20,8 +20,8 @@ import (
|
|
_ "github.com/go-macaron/cache/redis"
|
|
_ "github.com/go-macaron/cache/redis"
|
|
"github.com/go-macaron/session"
|
|
"github.com/go-macaron/session"
|
|
_ "github.com/go-macaron/session/redis"
|
|
_ "github.com/go-macaron/session/redis"
|
|
- "gopkg.in/ini.v1"
|
|
|
|
"github.com/strk/go-libravatar"
|
|
"github.com/strk/go-libravatar"
|
|
|
|
+ "gopkg.in/ini.v1"
|
|
|
|
|
|
"github.com/gogits/gogs/modules/bindata"
|
|
"github.com/gogits/gogs/modules/bindata"
|
|
"github.com/gogits/gogs/modules/log"
|
|
"github.com/gogits/gogs/modules/log"
|
|
@@ -141,11 +141,11 @@ var (
|
|
}
|
|
}
|
|
|
|
|
|
// Picture settings
|
|
// Picture settings
|
|
- AvatarUploadPath string
|
|
|
|
- GravatarSource string
|
|
|
|
- DisableGravatar bool
|
|
|
|
- EnableFederatedAvatar bool
|
|
|
|
- LibravatarService *libravatar.Libravatar
|
|
|
|
|
|
+ AvatarUploadPath string
|
|
|
|
+ GravatarSource string
|
|
|
|
+ DisableGravatar bool
|
|
|
|
+ EnableFederatedAvatar bool
|
|
|
|
+ LibravatarService *libravatar.Libravatar
|
|
|
|
|
|
// Log settings
|
|
// Log settings
|
|
LogRootPath string
|
|
LogRootPath string
|
|
@@ -470,8 +470,11 @@ func NewContext() {
|
|
DisableGravatar = true
|
|
DisableGravatar = true
|
|
EnableFederatedAvatar = false
|
|
EnableFederatedAvatar = false
|
|
}
|
|
}
|
|
|
|
+ if DisableGravatar {
|
|
|
|
+ EnableFederatedAvatar = false
|
|
|
|
+ }
|
|
|
|
|
|
- if !DisableGravatar && EnableFederatedAvatar {
|
|
|
|
|
|
+ if EnableFederatedAvatar {
|
|
LibravatarService = libravatar.New()
|
|
LibravatarService = libravatar.New()
|
|
parts := strings.Split(GravatarSource, "/")
|
|
parts := strings.Split(GravatarSource, "/")
|
|
if len(parts) >= 3 {
|
|
if len(parts) >= 3 {
|