summaryrefslogtreecommitdiffstats
path: root/model/command.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-04-04 08:15:13 -0700
committerCorey Hulen <corey@hulen.com>2016-04-04 08:15:13 -0700
commit578749d08315945020fcf4466a6f0709a128dbbf (patch)
tree190561a505b5f51bafd570c2c8c48196761a49e0 /model/command.go
parentead8e64ccb42081272bca1a498a08c05825ce9d0 (diff)
parent74daec08ce7f1b6a09e4b364f45b0f05f3c28a9e (diff)
downloadchat-578749d08315945020fcf4466a6f0709a128dbbf.tar.gz
chat-578749d08315945020fcf4466a6f0709a128dbbf.tar.bz2
chat-578749d08315945020fcf4466a6f0709a128dbbf.zip
Merge pull request #2584 from hmhealey/plt2054
PLT-2054 Add DisplayName and Description fields for integrations
Diffstat (limited to 'model/command.go')
-rw-r--r--model/command.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/model/command.go b/model/command.go
index 56d88f13c..ca3038122 100644
--- a/model/command.go
+++ b/model/command.go
@@ -29,6 +29,7 @@ type Command struct {
AutoCompleteDesc string `json:"auto_complete_desc"`
AutoCompleteHint string `json:"auto_complete_hint"`
DisplayName string `json:"display_name"`
+ Description string `json:"description"`
URL string `json:"url"`
}
@@ -114,6 +115,14 @@ func (o *Command) IsValid() *AppError {
return NewLocAppError("Command.IsValid", "model.command.is_valid.method.app_error", nil, "")
}
+ if len(o.DisplayName) > 64 {
+ return NewLocAppError("Command.IsValid", "model.command.is_valid.display_name.app_error", nil, "")
+ }
+
+ if len(o.Description) > 128 {
+ return NewLocAppError("Command.IsValid", "model.command.is_valid.description.app_error", nil, "")
+ }
+
return nil
}