mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-06-27 15:49:23 +00:00
Update mattermost vendor (3.7 => 4.1)
This commit is contained in:
7
vendor/github.com/mattermost/platform/model/reaction.go
generated
vendored
7
vendor/github.com/mattermost/platform/model/reaction.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
|
||||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
package model
|
||||
@ -6,6 +6,7 @@ package model
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
type Reaction struct {
|
||||
@ -60,7 +61,9 @@ func (o *Reaction) IsValid() *AppError {
|
||||
return NewLocAppError("Reaction.IsValid", "model.reaction.is_valid.post_id.app_error", nil, "post_id="+o.PostId)
|
||||
}
|
||||
|
||||
if len(o.EmojiName) == 0 || len(o.EmojiName) > 64 {
|
||||
validName := regexp.MustCompile(`^[a-zA-Z0-9\-\+_]+$`)
|
||||
|
||||
if len(o.EmojiName) == 0 || len(o.EmojiName) > 64 || !validName.MatchString(o.EmojiName) {
|
||||
return NewLocAppError("Reaction.IsValid", "model.reaction.is_valid.emoji_name.app_error", nil, "emoji_name="+o.EmojiName)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user