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 удалений

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

@@ -158,7 +158,7 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
sender: sender,
}
if a.Config().EmailSettings.SendEmailNotifications {
if *a.Config().EmailSettings.SendEmailNotifications {
for _, id := range mentionedUsersList {
if profileMap[id] == nil {
continue
@@ -180,7 +180,7 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
}
//If email verification is required and user email is not verified don't send email.
if a.Config().EmailSettings.RequireEmailVerification && !profileMap[id].EmailVerified {
if *a.Config().EmailSettings.RequireEmailVerification && !profileMap[id].EmailVerified {
mlog.Error(fmt.Sprintf("Skipped sending notification email to %v, address not verified. [details: user_id=%v]", profileMap[id].Email, id))
continue
}
@@ -325,7 +325,7 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
message.Add("channel_type", channel.Type)
message.Add("channel_display_name", notification.GetChannelName(model.SHOW_USERNAME, ""))
message.Add("channel_name", channel.Name)
message.Add("sender_name", notification.GetSenderName(model.SHOW_USERNAME, a.Config().ServiceSettings.EnablePostUsernameOverride))
message.Add("sender_name", notification.GetSenderName(model.SHOW_USERNAME, *a.Config().ServiceSettings.EnablePostUsernameOverride))
message.Add("team_id", team.Id)
if len(post.FileIds) != 0 && fchan != nil {