MM-10658 Change config fields to pointers (#9033)

* MM 10658 Change config fields to pointers (#8898)

* Change fields of config structs to pointers and set defaults

MM-10658 https://github.com/mattermost/mattermost-server/issues/8841

* Fix tests that go broken during switching config structs to pointers

MM-10658 https://github.com/mattermost/mattermost-server/issues/8841

* Apply changes of current master while switching config structs to pointers

MM-10658 https://github.com/mattermost/mattermost-server/issues/8841

* Fix new config pointer uses

* Fix app tests

* Fix mail test

* remove debugging statement

* fix TestUpdateConfig

* assign config consistently

* initialize AmazonS3Region in TestS3TestConnection

* initialize fields for TestEmailTest

* fix TestCheckMandatoryS3Fields
Этот коммит содержится в:
Joram Wilander
2019-01-31 08:12:01 -05:00
коммит произвёл GitHub
родитель 0c981aa010
Коммит 2ca222033c
53 изменённых файлов: 729 добавлений и 516 удалений

Просмотреть файл

@@ -119,7 +119,7 @@ func getUser(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
etag := user.Etag(c.App.Config().PrivacySettings.ShowFullName, c.App.Config().PrivacySettings.ShowEmailAddress)
etag := user.Etag(*c.App.Config().PrivacySettings.ShowFullName, *c.App.Config().PrivacySettings.ShowEmailAddress)
if c.HandleEtag(etag, "Get User", w, r) {
return
@@ -149,7 +149,7 @@ func getUserByUsername(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
etag := user.Etag(c.App.Config().PrivacySettings.ShowFullName, c.App.Config().PrivacySettings.ShowEmailAddress)
etag := user.Etag(*c.App.Config().PrivacySettings.ShowFullName, *c.App.Config().PrivacySettings.ShowEmailAddress)
if c.HandleEtag(etag, "Get User", w, r) {
return
@@ -184,7 +184,7 @@ func getUserByEmail(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
etag := user.Etag(c.App.Config().PrivacySettings.ShowFullName, c.App.Config().PrivacySettings.ShowEmailAddress)
etag := user.Etag(*c.App.Config().PrivacySettings.ShowFullName, *c.App.Config().PrivacySettings.ShowEmailAddress)
if c.HandleEtag(etag, "Get User", w, r) {
return
@@ -577,8 +577,8 @@ func searchUsers(c *Context, w http.ResponseWriter, r *http.Request) {
options.AllowEmails = true
options.AllowFullNames = true
} else {
options.AllowEmails = c.App.Config().PrivacySettings.ShowEmailAddress
options.AllowFullNames = c.App.Config().PrivacySettings.ShowFullName
options.AllowEmails = *c.App.Config().PrivacySettings.ShowEmailAddress
options.AllowFullNames = *c.App.Config().PrivacySettings.ShowFullName
}
profiles, err := c.App.SearchUsers(props, options)
@@ -610,7 +610,7 @@ func autocompleteUsers(c *Context, w http.ResponseWriter, r *http.Request) {
if c.App.SessionHasPermissionTo(c.App.Session, model.PERMISSION_MANAGE_SYSTEM) {
options.AllowFullNames = true
} else {
options.AllowFullNames = c.App.Config().PrivacySettings.ShowFullName
options.AllowFullNames = *c.App.Config().PrivacySettings.ShowFullName
}
if len(channelId) > 0 {