diff options
author | Wim <wim@42.be> | 2016-11-12 22:00:53 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2016-11-12 22:00:53 +0100 |
commit | 1d5cd1d7c479c382c9cddaf02f1e59bf55971f12 (patch) | |
tree | abaf22fc41326750e376f0831537bbbbe769d5b2 /vendor/github.com/mattermost/platform/model/post.go | |
parent | 08ebee6b4faf677da159db1cffea292050492fd5 (diff) | |
download | matterbridge-msglm-1d5cd1d7c479c382c9cddaf02f1e59bf55971f12.tar.gz matterbridge-msglm-1d5cd1d7c479c382c9cddaf02f1e59bf55971f12.tar.bz2 matterbridge-msglm-1d5cd1d7c479c382c9cddaf02f1e59bf55971f12.zip |
Sync with mattermost 3.5.0
Diffstat (limited to 'vendor/github.com/mattermost/platform/model/post.go')
-rw-r--r-- | vendor/github.com/mattermost/platform/model/post.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/vendor/github.com/mattermost/platform/model/post.go b/vendor/github.com/mattermost/platform/model/post.go index 33caeb9e..da14b650 100644 --- a/vendor/github.com/mattermost/platform/model/post.go +++ b/vendor/github.com/mattermost/platform/model/post.go @@ -35,7 +35,8 @@ type Post struct { Type string `json:"type"` Props StringInterface `json:"props"` Hashtags string `json:"hashtags"` - Filenames StringArray `json:"filenames"` + Filenames StringArray `json:"filenames,omitempty"` // Deprecated, do not use this field any more + FileIds StringArray `json:"file_ids,omitempty"` PendingPostId string `json:"pending_post_id" db:"-"` } @@ -118,6 +119,10 @@ func (o *Post) IsValid() *AppError { return NewLocAppError("Post.IsValid", "model.post.is_valid.filenames.app_error", nil, "id="+o.Id) } + if utf8.RuneCountInString(ArrayToJson(o.FileIds)) > 150 { + return NewLocAppError("Post.IsValid", "model.post.is_valid.file_ids.app_error", nil, "id="+o.Id) + } + if utf8.RuneCountInString(StringInterfaceToJson(o.Props)) > 8000 { return NewLocAppError("Post.IsValid", "model.post.is_valid.props.app_error", nil, "id="+o.Id) } @@ -145,15 +150,16 @@ func (o *Post) PreSave() { if o.Filenames == nil { o.Filenames = []string{} } + + if o.FileIds == nil { + o.FileIds = []string{} + } } func (o *Post) MakeNonNil() { if o.Props == nil { o.Props = make(map[string]interface{}) } - if o.Filenames == nil { - o.Filenames = []string{} - } } func (o *Post) AddProp(key string, value interface{}) { |