diff options
author | Derrick Anderson <derrick@andersonwebstudio.com> | 2018-04-10 10:55:25 -0400 |
---|---|---|
committer | Derrick Anderson <derrick@andersonwebstudio.com> | 2018-04-10 10:55:25 -0400 |
commit | 332411490ded04b66d3cf843a4f31ba64aeb6d6f (patch) | |
tree | 5f3841176e2609ba0fb6e5a238b967ff454027c3 | |
parent | 0a6b96cb40d9dd5acca7e366df9cd14fa4eff6a7 (diff) | |
parent | 5856325c13ac8b9105a7ea6f674f0bf8a42fd0c1 (diff) | |
download | chat-332411490ded04b66d3cf843a4f31ba64aeb6d6f.tar.gz chat-332411490ded04b66d3cf843a4f31ba64aeb6d6f.tar.bz2 chat-332411490ded04b66d3cf843a4f31ba64aeb6d6f.zip |
Merge branch 'jespino-merge-release-4.9'
-rw-r--r-- | app/notification.go | 12 | ||||
-rw-r--r-- | app/notification_test.go | 6 | ||||
-rw-r--r-- | glide.lock | 9 | ||||
-rw-r--r-- | glide.yaml | 3 | ||||
-rw-r--r-- | jobs/jobs.go | 2 | ||||
-rw-r--r-- | vendor/github.com/minio/minio-go/api-put-object-multipart.go | 14 | ||||
-rw-r--r-- | vendor/github.com/minio/minio-go/api-put-object.go | 2 |
7 files changed, 27 insertions, 21 deletions
diff --git a/app/notification.go b/app/notification.go index 0ea03c9d9..5b7ed5ad2 100644 --- a/app/notification.go +++ b/app/notification.go @@ -897,7 +897,9 @@ func GetExplicitMentions(message string, keywords map[string][]string) *Explicit continue } - if strings.ContainsAny(word, ".-:") { + if _, ok := systemMentions[word]; !ok && strings.HasPrefix(word, "@") { + ret.OtherPotentialMentions = append(ret.OtherPotentialMentions, word[1:]) + } else if strings.ContainsAny(word, ".-:") { // This word contains a character that may be the end of a sentence, so split further splitWords := strings.FieldsFunc(word, func(c rune) bool { return c == '.' || c == '-' || c == ':' @@ -908,16 +910,10 @@ func GetExplicitMentions(message string, keywords map[string][]string) *Explicit continue } if _, ok := systemMentions[splitWord]; !ok && strings.HasPrefix(splitWord, "@") { - username := splitWord[1:] - ret.OtherPotentialMentions = append(ret.OtherPotentialMentions, username) + ret.OtherPotentialMentions = append(ret.OtherPotentialMentions, splitWord[1:]) } } } - - if _, ok := systemMentions[word]; !ok && strings.HasPrefix(word, "@") { - username := word[1:] - ret.OtherPotentialMentions = append(ret.OtherPotentialMentions, username) - } } } diff --git a/app/notification_test.go b/app/notification_test.go index c72610b60..1abdd3d61 100644 --- a/app/notification_test.go +++ b/app/notification_test.go @@ -234,6 +234,12 @@ func TestGetExplicitMentions(t *testing.T) { OtherPotentialMentions: []string{"potential"}, }, }, + "PotentialOutOfChannelUserWithPeriod": { + Message: "this is an message for @potential.user", + Expected: &ExplicitMentions{ + OtherPotentialMentions: []string{"potential.user"}, + }, + }, "InlineCode": { Message: "`this shouldn't mention @channel at all`", Keywords: map[string][]string{}, diff --git a/glide.lock b/glide.lock index 97d46263d..9fc53b688 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: 287b82849f1c7303ee3eb29c9d0879d404469f7df2ba9b37828e55b0320ef11f -updated: 2018-03-21T13:01:34.996412416+01:00 +hash: 7d775d1a082e77da96bee605ebea97ba0230e270f7169fade50f64e5fe7842cb +updated: 2018-04-05T18:31:48.282177324+02:00 imports: - name: github.com/alecthomas/log4go version: 3fbce08846379ec7f4f6bc7fce6dd01ce28fae4c @@ -117,6 +117,8 @@ imports: version: 995ddf2264c4ad45fbaf342f7500e4787ebae84a - name: github.com/mattermost/html2text version: d47a5532a7bc36ad7b2b8ec3eebe24e975154f94 +- name: github.com/mattermost/minio-go + version: e30d3b9eaff9a3fbfa74cda4c56cb22bec264ffa - name: github.com/mattermost/rsc version: bbaefb05eaa0389ea712340066837c8ce4d287f9 subpackages: @@ -130,7 +132,8 @@ imports: - name: github.com/miekg/dns version: 5364553f1ee9cddc7ac8b62dce148309c386695b - name: github.com/minio/minio-go - version: 706c81d3ee2a18cdd8239faf544de8a066e7e261 + version: e30d3b9eaff9a3fbfa74cda4c56cb22bec264ffa + repo: https://github.com/mattermost/minio-go.git subpackages: - pkg/credentials - pkg/encrypt diff --git a/glide.yaml b/glide.yaml index 62131f91f..d166f8573 100644 --- a/glide.yaml +++ b/glide.yaml @@ -31,7 +31,8 @@ import: subpackages: - qr - package: github.com/minio/minio-go - version: 4.0.7 + repo: https://github.com/mattermost/minio-go.git + version: 4.0.7.1 subpackages: - pkg/credentials - package: github.com/nicksnyder/go-i18n diff --git a/jobs/jobs.go b/jobs/jobs.go index f0a74e45a..b367730b5 100644 --- a/jobs/jobs.go +++ b/jobs/jobs.go @@ -81,7 +81,7 @@ func (srv *JobServer) SetJobError(job *model.Job, jobError *model.AppError) *mod if job.Data == nil { job.Data = make(map[string]string) } - job.Data["error"] = jobError.Message + " (" + jobError.DetailedError + ")" + job.Data["error"] = jobError.Message + " — " + jobError.DetailedError if result := <-srv.Store.Job().UpdateOptimistically(job, model.JOB_STATUS_IN_PROGRESS); result.Err != nil { return result.Err diff --git a/vendor/github.com/minio/minio-go/api-put-object-multipart.go b/vendor/github.com/minio/minio-go/api-put-object-multipart.go index f5b8893e6..5262e8b91 100644 --- a/vendor/github.com/minio/minio-go/api-put-object-multipart.go +++ b/vendor/github.com/minio/minio-go/api-put-object-multipart.go @@ -260,13 +260,13 @@ func (c Client) uploadPart(ctx context.Context, bucketName, objectName, uploadID // Set encryption headers, if any. customHeader := make(http.Header) - for k, v := range metadata { - if len(v) > 0 { - if strings.HasPrefix(strings.ToLower(k), serverEncryptionKeyPrefix) { - customHeader.Set(k, v) - } - } - } + // for k, v := range metadata { + // if len(v) > 0 { + // if strings.HasPrefix(strings.ToLower(k), serverEncryptionKeyPrefix) { + // customHeader.Set(k, v) + // } + // } + // } reqMetadata := requestMetadata{ bucketName: bucketName, diff --git a/vendor/github.com/minio/minio-go/api-put-object.go b/vendor/github.com/minio/minio-go/api-put-object.go index 6d90eab74..ca4052225 100644 --- a/vendor/github.com/minio/minio-go/api-put-object.go +++ b/vendor/github.com/minio/minio-go/api-put-object.go @@ -207,7 +207,7 @@ func (c Client) putObjectMultipartStreamNoLength(ctx context.Context, bucketName if rErr == io.EOF && partNumber > 1 { break } - if rErr != nil && rErr != io.ErrUnexpectedEOF { + if rErr != nil && rErr != io.ErrUnexpectedEOF && rErr != io.EOF { return 0, rErr } // Update progress reader appropriately to the latest offset |