diff options
Diffstat (limited to 'model')
-rw-r--r-- | model/channel.go | 5 | ||||
-rw-r--r-- | model/post.go | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/model/channel.go b/model/channel.go index 94b8fdb43..b46f79f75 100644 --- a/model/channel.go +++ b/model/channel.go @@ -28,6 +28,7 @@ type Channel struct { LastPostAt int64 `json:"last_post_at"` TotalMsgCount int64 `json:"total_msg_count"` ExtraUpdateAt int64 `json:"extra_update_at"` + CreatorId string `json:"creator_id"` } func (o *Channel) ToJson() string { @@ -92,6 +93,10 @@ func (o *Channel) IsValid() *AppError { return NewAppError("Channel.IsValid", "Invalid description", "id="+o.Id) } + if len(o.CreatorId) > 26 { + return NewAppError("Channel.IsValid", "Invalid creator id", "") + } + return nil } diff --git a/model/post.go b/model/post.go index 0c035d4e7..f8a3032a3 100644 --- a/model/post.go +++ b/model/post.go @@ -120,7 +120,9 @@ func (o *Post) PreSave() { o.OriginalId = "" - o.CreateAt = GetMillis() + if o.CreateAt <= 0 { + o.CreateAt = GetMillis() + } o.UpdateAt = o.CreateAt if o.Props == nil { |