diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2015-10-27 11:04:23 -0400 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2015-10-27 12:46:31 -0400 |
commit | 61da22ea32a71015191e94665171e9703bd39211 (patch) | |
tree | 44c236004bade907e5c437f9911a1a090203bf65 /model/channel.go | |
parent | 887d205b1fbb3188331a324ba59b7ec187a2d772 (diff) | |
download | chat-61da22ea32a71015191e94665171e9703bd39211.tar.gz chat-61da22ea32a71015191e94665171e9703bd39211.tar.bz2 chat-61da22ea32a71015191e94665171e9703bd39211.zip |
Added Channel.Purpose on the server
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 caf1bfd80..ac54a7e44 100644 --- a/model/channel.go +++ b/model/channel.go @@ -25,6 +25,7 @@ type Channel struct { DisplayName string `json:"display_name"` Name string `json:"name"` Header string `json:"header"` + Purpose string `json:"purpose"` LastPostAt int64 `json:"last_post_at"` TotalMsgCount int64 `json:"total_msg_count"` ExtraUpdateAt int64 `json:"extra_update_at"` @@ -93,6 +94,10 @@ func (o *Channel) IsValid() *AppError { return NewAppError("Channel.IsValid", "Invalid header", "id="+o.Id) } + if len(o.Purpose) > 128 { + return NewAppError("Channel.IsValid", "Invalid purpose", "id="+o.Id) + } + if len(o.CreatorId) > 26 { return NewAppError("Channel.IsValid", "Invalid creator id", "") } |