mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Merge branch 'release-4.1'
This commit is contained in:
11
app/file.go
11
app/file.go
@@ -115,8 +115,11 @@ func MoveFile(oldPath, newPath string) *model.AppError {
|
||||
secretKey := utils.Cfg.FileSettings.AmazonS3SecretAccessKey
|
||||
secure := *utils.Cfg.FileSettings.AmazonS3SSL
|
||||
signV2 := *utils.Cfg.FileSettings.AmazonS3SignV2
|
||||
encrypt := *utils.Cfg.FileSettings.AmazonS3SSE
|
||||
region := utils.Cfg.FileSettings.AmazonS3Region
|
||||
encrypt := false
|
||||
if *utils.Cfg.FileSettings.AmazonS3SSE && utils.IsLicensed && *utils.License.Features.Compliance {
|
||||
encrypt = true
|
||||
}
|
||||
s3Clnt, err := s3New(endpoint, accessKey, secretKey, secure, signV2, region)
|
||||
if err != nil {
|
||||
return model.NewLocAppError("moveFile", "api.file.write_file.s3.app_error", nil, err.Error())
|
||||
@@ -156,8 +159,12 @@ func WriteFile(f []byte, path string) *model.AppError {
|
||||
secretKey := utils.Cfg.FileSettings.AmazonS3SecretAccessKey
|
||||
secure := *utils.Cfg.FileSettings.AmazonS3SSL
|
||||
signV2 := *utils.Cfg.FileSettings.AmazonS3SignV2
|
||||
encrypt := *utils.Cfg.FileSettings.AmazonS3SSE
|
||||
region := utils.Cfg.FileSettings.AmazonS3Region
|
||||
encrypt := false
|
||||
if *utils.Cfg.FileSettings.AmazonS3SSE && utils.IsLicensed && *utils.License.Features.Compliance {
|
||||
encrypt = true
|
||||
}
|
||||
|
||||
s3Clnt, err := s3New(endpoint, accessKey, secretKey, secure, signV2, region)
|
||||
if err != nil {
|
||||
return model.NewLocAppError("WriteFile", "api.file.write_file.s3.app_error", nil, err.Error())
|
||||
|
||||
@@ -333,8 +333,8 @@ func sendNotificationEmail(post *model.Post, user *model.User, channel *model.Ch
|
||||
if *utils.Cfg.EmailSettings.EnableEmailBatching {
|
||||
var sendBatched bool
|
||||
if result := <-Srv.Store.Preference().Get(user.Id, model.PREFERENCE_CATEGORY_NOTIFICATIONS, model.PREFERENCE_NAME_EMAIL_INTERVAL); result.Err != nil {
|
||||
// if the call fails, assume it hasn't been set and don't batch notifications for this user
|
||||
sendBatched = false
|
||||
// if the call fails, assume that the interval has not been explicitly set and batch the notifications
|
||||
sendBatched = true
|
||||
} else {
|
||||
// if the user has chosen to receive notifications immediately, don't batch them
|
||||
sendBatched = result.Data.(model.Preference).Value != model.PREFERENCE_EMAIL_INTERVAL_NO_BATCHING_SECONDS
|
||||
|
||||
@@ -682,16 +682,16 @@ func AuthorizeOAuthUser(w http.ResponseWriter, r *http.Request, service, code, s
|
||||
ar = model.AccessResponseFromJson(resp.Body)
|
||||
defer CloseBody(resp)
|
||||
if ar == nil {
|
||||
return nil, "", nil, model.NewLocAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.bad_response.app_error", nil, "response_body="+string(bodyBytes))
|
||||
return nil, "", stateProps, model.NewLocAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.bad_response.app_error", nil, "response_body="+string(bodyBytes))
|
||||
}
|
||||
}
|
||||
|
||||
if strings.ToLower(ar.TokenType) != model.ACCESS_TOKEN_TYPE {
|
||||
return nil, "", nil, model.NewLocAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.bad_token.app_error", nil, "token_type="+ar.TokenType+", response_body="+string(bodyBytes))
|
||||
return nil, "", stateProps, model.NewLocAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.bad_token.app_error", nil, "token_type="+ar.TokenType+", response_body="+string(bodyBytes))
|
||||
}
|
||||
|
||||
if len(ar.AccessToken) == 0 {
|
||||
return nil, "", nil, model.NewLocAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.missing.app_error", nil, "response_body="+string(bodyBytes))
|
||||
return nil, "", stateProps, model.NewLocAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.missing.app_error", nil, "response_body="+string(bodyBytes))
|
||||
}
|
||||
|
||||
p = url.Values{}
|
||||
|
||||
Reference in New Issue
Block a user