diff options
author | JoramWilander <jwawilander@gmail.com> | 2015-08-19 08:31:20 -0400 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2015-08-19 08:31:20 -0400 |
commit | 11247061b5623140656e3ec0ee96b6566637a950 (patch) | |
tree | ed815e8676b3abb436fc77226b485f6f33245002 /model/channel.go | |
parent | 7004a348b59d5572e8c84eb1c8138bf45cbd0d3e (diff) | |
download | chat-11247061b5623140656e3ec0ee96b6566637a950.tar.gz chat-11247061b5623140656e3ec0ee96b6566637a950.tar.bz2 chat-11247061b5623140656e3ec0ee96b6566637a950.zip |
Track channel creator in DB and show in channel intro message.
Diffstat (limited to 'model/channel.go')
-rw-r--r-- | model/channel.go | 5 |
1 files changed, 5 insertions, 0 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 } |