summaryrefslogtreecommitdiffstats
path: root/model/command.go
diff options
context:
space:
mode:
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
}