summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/platform/model/channel.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2016-11-12 22:00:53 +0100
committerWim <wim@42.be>2016-11-12 22:00:53 +0100
commit1d5cd1d7c479c382c9cddaf02f1e59bf55971f12 (patch)
treeabaf22fc41326750e376f0831537bbbbe769d5b2 /vendor/github.com/mattermost/platform/model/channel.go
parent08ebee6b4faf677da159db1cffea292050492fd5 (diff)
downloadmatterbridge-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/channel.go')
-rw-r--r--vendor/github.com/mattermost/platform/model/channel.go24
1 files changed, 14 insertions, 10 deletions
diff --git a/vendor/github.com/mattermost/platform/model/channel.go b/vendor/github.com/mattermost/platform/model/channel.go
index 3da9f4fe..2ad257cc 100644
--- a/vendor/github.com/mattermost/platform/model/channel.go
+++ b/vendor/github.com/mattermost/platform/model/channel.go
@@ -10,10 +10,14 @@ import (
)
const (
- CHANNEL_OPEN = "O"
- CHANNEL_PRIVATE = "P"
- CHANNEL_DIRECT = "D"
- DEFAULT_CHANNEL = "town-square"
+ CHANNEL_OPEN = "O"
+ CHANNEL_PRIVATE = "P"
+ CHANNEL_DIRECT = "D"
+ DEFAULT_CHANNEL = "town-square"
+ CHANNEL_DISPLAY_NAME_MAX_RUNES = 64
+ CHANNEL_NAME_MAX_LENGTH = 64
+ CHANNEL_HEADER_MAX_RUNES = 1024
+ CHANNEL_PURPOSE_MAX_RUNES = 250
)
type Channel struct {
@@ -57,8 +61,8 @@ func (o *Channel) Etag() string {
return Etag(o.Id, o.UpdateAt)
}
-func (o *Channel) ExtraEtag(memberLimit int) string {
- return Etag(o.Id, o.ExtraUpdateAt, memberLimit)
+func (o *Channel) StatsEtag() string {
+ return Etag(o.Id, o.ExtraUpdateAt)
}
func (o *Channel) IsValid() *AppError {
@@ -75,11 +79,11 @@ func (o *Channel) IsValid() *AppError {
return NewLocAppError("Channel.IsValid", "model.channel.is_valid.update_at.app_error", nil, "id="+o.Id)
}
- if utf8.RuneCountInString(o.DisplayName) > 64 {
+ if utf8.RuneCountInString(o.DisplayName) > CHANNEL_DISPLAY_NAME_MAX_RUNES {
return NewLocAppError("Channel.IsValid", "model.channel.is_valid.display_name.app_error", nil, "id="+o.Id)
}
- if len(o.Name) > 64 {
+ if len(o.Name) > CHANNEL_NAME_MAX_LENGTH {
return NewLocAppError("Channel.IsValid", "model.channel.is_valid.name.app_error", nil, "id="+o.Id)
}
@@ -91,11 +95,11 @@ func (o *Channel) IsValid() *AppError {
return NewLocAppError("Channel.IsValid", "model.channel.is_valid.type.app_error", nil, "id="+o.Id)
}
- if utf8.RuneCountInString(o.Header) > 1024 {
+ if utf8.RuneCountInString(o.Header) > CHANNEL_HEADER_MAX_RUNES {
return NewLocAppError("Channel.IsValid", "model.channel.is_valid.header.app_error", nil, "id="+o.Id)
}
- if utf8.RuneCountInString(o.Purpose) > 128 {
+ if utf8.RuneCountInString(o.Purpose) > CHANNEL_PURPOSE_MAX_RUNES {
return NewLocAppError("Channel.IsValid", "model.channel.is_valid.purpose.app_error", nil, "id="+o.Id)
}