summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
Diffstat (limited to 'model')
-rw-r--r--model/client4.go2
-rw-r--r--model/config.go5
-rw-r--r--model/post.go29
3 files changed, 28 insertions, 8 deletions
diff --git a/model/client4.go b/model/client4.go
index 916e9d6de..d37fb3b0f 100644
--- a/model/client4.go
+++ b/model/client4.go
@@ -2649,7 +2649,7 @@ func (c *Client4) UploadBrandImage(data []byte) (bool, *Response) {
// GetLogs page of logs as a string array.
func (c *Client4) GetLogs(page, perPage int) ([]string, *Response) {
- query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage)
+ query := fmt.Sprintf("?page=%v&logs_per_page=%v", page, perPage)
if r, err := c.DoApiGet("/logs"+query, ""); err != nil {
return nil, BuildErrorResponse(r, err)
} else {
diff --git a/model/config.go b/model/config.go
index 544f9b33f..918d15b9a 100644
--- a/model/config.go
+++ b/model/config.go
@@ -212,6 +212,7 @@ type ServiceSettings struct {
ClusterLogTimeoutMilliseconds *int
CloseUnusedDirectMessages *bool
EnablePreviewFeatures *bool
+ EnableTutorial *bool
}
func (s *ServiceSettings) SetDefaults() {
@@ -331,6 +332,10 @@ func (s *ServiceSettings) SetDefaults() {
s.CloseUnusedDirectMessages = NewBool(false)
}
+ if s.EnableTutorial == nil {
+ s.EnableTutorial = NewBool(true)
+ }
+
if s.SessionLengthWebInDays == nil {
s.SessionLengthWebInDays = NewInt(30)
}
diff --git a/model/post.go b/model/post.go
index b7b38e7ad..3873e6113 100644
--- a/model/post.go
+++ b/model/post.go
@@ -20,6 +20,7 @@ const (
POST_JOIN_LEAVE = "system_join_leave" // Deprecated, use POST_JOIN_CHANNEL or POST_LEAVE_CHANNEL instead
POST_JOIN_CHANNEL = "system_join_channel"
POST_LEAVE_CHANNEL = "system_leave_channel"
+ POST_JOIN_TEAM = "system_join_team"
POST_LEAVE_TEAM = "system_leave_team"
POST_ADD_REMOVE = "system_add_remove" // Deprecated, use POST_ADD_TO_CHANNEL or POST_REMOVE_FROM_CHANNEL instead
POST_ADD_TO_CHANNEL = "system_add_to_channel"
@@ -169,13 +170,27 @@ func (o *Post) IsValid() *AppError {
return NewAppError("Post.IsValid", "model.post.is_valid.hashtags.app_error", nil, "id="+o.Id, http.StatusBadRequest)
}
- if !(o.Type == POST_DEFAULT || o.Type == POST_JOIN_LEAVE || o.Type == POST_ADD_REMOVE ||
- o.Type == POST_JOIN_CHANNEL || o.Type == POST_LEAVE_CHANNEL || o.Type == POST_LEAVE_TEAM ||
- o.Type == POST_REMOVE_FROM_CHANNEL || o.Type == POST_ADD_TO_CHANNEL || o.Type == POST_ADD_TO_TEAM ||
- o.Type == POST_SLACK_ATTACHMENT || o.Type == POST_HEADER_CHANGE || o.Type == POST_PURPOSE_CHANGE ||
- o.Type == POST_DISPLAYNAME_CHANGE || o.Type == POST_CHANNEL_DELETED ||
- strings.HasPrefix(o.Type, POST_CUSTOM_TYPE_PREFIX)) {
- return NewAppError("Post.IsValid", "model.post.is_valid.type.app_error", nil, "id="+o.Type, http.StatusBadRequest)
+ switch o.Type {
+ case
+ POST_DEFAULT,
+ POST_JOIN_LEAVE,
+ POST_ADD_REMOVE,
+ POST_JOIN_CHANNEL,
+ POST_LEAVE_CHANNEL,
+ POST_LEAVE_TEAM,
+ POST_REMOVE_FROM_CHANNEL,
+ POST_ADD_TO_CHANNEL,
+ POST_ADD_TO_TEAM,
+ POST_JOIN_TEAM,
+ POST_SLACK_ATTACHMENT,
+ POST_HEADER_CHANGE,
+ POST_PURPOSE_CHANGE,
+ POST_DISPLAYNAME_CHANGE,
+ POST_CHANNEL_DELETED:
+ default:
+ if !strings.HasPrefix(o.Type, POST_CUSTOM_TYPE_PREFIX) {
+ return NewAppError("Post.IsValid", "model.post.is_valid.type.app_error", nil, "id="+o.Type, http.StatusBadRequest)
+ }
}
if utf8.RuneCountInString(ArrayToJson(o.Filenames)) > POST_FILENAMES_MAX_RUNES {