* Removing some other fake apps

* More FakeApp removed

* Removing entirely FakeApp

* Fixing some tests

* Fixing get Cluster id from get plugin status

* Fixing failing tests

* Fixing tests

* Fixing test initialization for web

* Fixing InitServer for server tests

* Fixing InitServer for server tests

* Reverting go.sum and go.mod

* Removing unneded HTMLTemplates function in App layer

* Moving back some functions to its old place to easy the review

* Moving back some functions to its old place to easy the review

* Using the last struct2interface version

* Generating store layers

* Fixing merge problems

* Addressing PR comments

* Small fix

* Fixing app tests build

* Fixing tests

* fixing tests

* Fix tests

* Fixing tests

* Fixing tests

* Fixing tests

* Moving license to server struct

* Adding some fixes to the test compilation

* Fixing cluster and some jobs initialization

* Fixing some license tests compilation problems

* Fixing recursive cache invalidation

* Regenerating app layers

* Fix test compilation

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Jesús Espino
2020-06-12 13:43:50 +02:00
коммит произвёл GitHub
родитель f3ac33e6dc
Коммит f5eab1271b
88 изменённых файлов: 973 добавлений и 1177 удалений

Просмотреть файл

@@ -194,7 +194,7 @@ func (a *App) CreatePost(post *model.Post, channel *model.Channel, triggerWebhoo
post.AddProp("from_bot", "true")
}
if a.License() != nil && *a.Config().TeamSettings.ExperimentalTownSquareIsReadOnly &&
if a.Srv().License() != nil && *a.Config().TeamSettings.ExperimentalTownSquareIsReadOnly &&
!post.IsSystemMessage() &&
channel.Name == model.DEFAULT_CHANNEL &&
!a.RolesGrantPermission(user.GetRoles(), model.PERMISSION_MANAGE_SYSTEM.Id) {
@@ -406,7 +406,7 @@ func (a *App) FillInPostProps(post *model.Post, channel *model.Channel) *model.A
}
matched := model.AT_MENTION_PATTEN.MatchString(post.Message)
if a.License() != nil && *a.License().Features.LDAPGroups && matched && !a.HasPermissionToChannel(post.UserId, post.ChannelId, model.PERMISSION_USE_GROUP_MENTIONS) {
if a.Srv().License() != nil && *a.Srv().License().Features.LDAPGroups && matched && !a.HasPermissionToChannel(post.UserId, post.ChannelId, model.PERMISSION_USE_GROUP_MENTIONS) {
post.AddProp(model.POST_PROPS_GROUP_HIGHLIGHT_DISABLED, true)
}
@@ -533,7 +533,7 @@ func (a *App) UpdatePost(post *model.Post, safeUpdate bool) (*model.Post, *model
return nil, err
}
if a.License() != nil {
if a.Srv().License() != nil {
if *a.Config().ServiceSettings.PostEditTimeLimit != -1 && model.GetMillis() > oldPost.CreateAt+int64(*a.Config().ServiceSettings.PostEditTimeLimit*1000) && post.Message != oldPost.Message {
err = model.NewAppError("UpdatePost", "api.post.update_post.permissions_time_limit.app_error", map[string]interface{}{"timeLimit": *a.Config().ServiceSettings.PostEditTimeLimit}, "", http.StatusBadRequest)
return nil, err
@@ -1120,8 +1120,8 @@ func (a *App) ImageProxyRemover() (f func(string) string) {
}
}
func (a *App) MaxPostSize() int {
maxPostSize := a.Srv().Store.Post().GetMaxPostSize()
func (s *Server) MaxPostSize() int {
maxPostSize := s.Store.Post().GetMaxPostSize()
if maxPostSize == 0 {
return model.POST_MESSAGE_MAX_RUNES_V1
}
@@ -1129,6 +1129,10 @@ func (a *App) MaxPostSize() int {
return maxPostSize
}
func (a *App) MaxPostSize() int {
return a.Srv().MaxPostSize()
}
// countMentionsFromPost returns the number of posts in the post's channel that mention the user after and including the
// given post.
func (a *App) countMentionsFromPost(user *model.User, post *model.Post) (int, *model.AppError) {