mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-07-05 09:24:03 +00:00
Update vendor (#1265)
This commit is contained in:
16
vendor/github.com/mattermost/mattermost-server/v5/model/post.go
generated
vendored
16
vendor/github.com/mattermost/mattermost-server/v5/model/post.go
generated
vendored
@ -64,6 +64,7 @@ const (
|
||||
|
||||
POST_PROPS_MENTION_HIGHLIGHT_DISABLED = "mentionHighlightDisabled"
|
||||
POST_PROPS_GROUP_HIGHLIGHT_DISABLED = "disable_group_highlight"
|
||||
POST_SYSTEM_WARN_METRIC_STATUS = "warn_metric_status"
|
||||
)
|
||||
|
||||
var AT_MENTION_PATTEN = regexp.MustCompile(`\B@`)
|
||||
@ -312,7 +313,8 @@ func (o *Post) IsValid(maxPostSize int) *AppError {
|
||||
POST_CHANNEL_RESTORED,
|
||||
POST_CHANGE_CHANNEL_PRIVACY,
|
||||
POST_ME,
|
||||
POST_ADD_BOT_TEAMS_CHANNELS:
|
||||
POST_ADD_BOT_TEAMS_CHANNELS,
|
||||
POST_SYSTEM_WARN_METRIC_STATUS:
|
||||
default:
|
||||
if !strings.HasPrefix(o.Type, POST_CUSTOM_TYPE_PREFIX) {
|
||||
return NewAppError("Post.IsValid", "model.post.is_valid.type.app_error", nil, "id="+o.Type, http.StatusBadRequest)
|
||||
@ -495,15 +497,14 @@ func (o *SearchParameter) SearchParameterToJson() string {
|
||||
return string(b)
|
||||
}
|
||||
|
||||
func SearchParameterFromJson(data io.Reader) *SearchParameter {
|
||||
func SearchParameterFromJson(data io.Reader) (*SearchParameter, error) {
|
||||
decoder := json.NewDecoder(data)
|
||||
var searchParam SearchParameter
|
||||
err := decoder.Decode(&searchParam)
|
||||
if err != nil {
|
||||
return nil
|
||||
if err := decoder.Decode(&searchParam); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &searchParam
|
||||
return &searchParam, nil
|
||||
}
|
||||
|
||||
func (o *Post) ChannelMentions() []string {
|
||||
@ -521,6 +522,9 @@ func (o *Post) DisableMentionHighlights() string {
|
||||
|
||||
// DisableMentionHighlights disables mention highlighting for a post patch if required.
|
||||
func (o *PostPatch) DisableMentionHighlights() {
|
||||
if o.Message == nil {
|
||||
return
|
||||
}
|
||||
if _, hasMentions := findAtChannelMention(*o.Message); hasMentions {
|
||||
if o.Props == nil {
|
||||
o.Props = &StringInterface{}
|
||||
|
Reference in New Issue
Block a user