4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-09-16 07:12:31 +00:00

Sync with mattermost 3.0

This commit is contained in:
Wim
2016-05-15 23:02:30 +02:00
parent 38e3bbe5c9
commit 59e6abcc11
22 changed files with 850 additions and 242 deletions

View File

@@ -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"`
}
@@ -98,7 +99,7 @@ func (o *Command) IsValid() *AppError {
return NewLocAppError("Command.IsValid", "model.command.is_valid.team_id.app_error", nil, "")
}
if len(o.Trigger) > 1024 {
if len(o.Trigger) == 0 || len(o.Trigger) > 128 {
return NewLocAppError("Command.IsValid", "model.command.is_valid.trigger.app_error", nil, "")
}
@@ -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
}