diff options
author | 无闻 <u@gogs.io> | 2015-08-10 11:36:59 +0800 |
---|---|---|
committer | 无闻 <u@gogs.io> | 2015-08-10 11:36:59 +0800 |
commit | 8f2a184e0441d2abb588cd363958e7008065a3ee (patch) | |
tree | 80032f6b465ae060fee5f53ad9bd9931e70ca65a /modules | |
parent | 8a3ee795d2d069bbb57b3d134367078c8e8391d5 (diff) | |
parent | 16f74b62b98a978deb26167888d1881708a84268 (diff) | |
download | gitea-8f2a184e0441d2abb588cd363958e7008065a3ee.tar.gz gitea-8f2a184e0441d2abb588cd363958e7008065a3ee.zip |
Merge pull request #1457 from jqs7/customAvatar
add custom avatar source support
Diffstat (limited to 'modules')
-rw-r--r-- | modules/setting/setting.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 7f9d9908f8..d32df47368 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -15,10 +15,11 @@ import ( "strings" "time" + "gopkg.in/ini.v1" + "github.com/Unknwon/com" "github.com/macaron-contrib/oauth2" "github.com/macaron-contrib/session" - "gopkg.in/ini.v1" "github.com/gogits/gogs/modules/bindata" "github.com/gogits/gogs/modules/log" @@ -345,11 +346,13 @@ func NewConfigContext() { if !filepath.IsAbs(AvatarUploadPath) { AvatarUploadPath = path.Join(workDir, AvatarUploadPath) } - switch sec.Key("GRAVATAR_SOURCE").MustString("gravatar") { + switch source := sec.Key("GRAVATAR_SOURCE").MustString("gravatar"); source { case "duoshuo": GravatarSource = "http://gravatar.duoshuo.com/avatar/" - default: + case "gravatar": GravatarSource = "//1.gravatar.com/avatar/" + default: + GravatarSource = source } DisableGravatar = sec.Key("DISABLE_GRAVATAR").MustBool() if OfflineMode { |