Move some variables out of model (#17909)

* Move some variables out of model

There were some stuff that's not necessary to be in model
and can just remain unexported variables.

```release-note
NONE
```

* Add license

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2021-07-13 19:26:20 +05:30
коммит произвёл Claudio Costa
родитель 97ccf0bdf6
Коммит f49b5dc440
6 изменённых файлов: 51 добавлений и 59 удалений

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

@@ -9,6 +9,7 @@ import (
"errors"
"fmt"
"net/http"
"regexp"
"strings"
"sync"
"time"
@@ -29,6 +30,8 @@ const (
PageDefault = 0
)
var atMentionPattern = regexp.MustCompile(`\B@`)
func (a *App) CreatePostAsUser(c *request.Context, post *model.Post, currentSessionId string, setOnline bool) (*model.Post, *model.AppError) {
// Check that channel has not been deleted
channel, errCh := a.Srv().Store.Channel().Get(post.ChannelId, true)
@@ -442,7 +445,7 @@ func (a *App) FillInPostProps(post *model.Post, channel *model.Channel) *model.A
post.DelProp("channel_mentions")
}
matched := model.AtMentionPattern.MatchString(post.Message)
matched := atMentionPattern.MatchString(post.Message)
if a.Srv().License() != nil && *a.Srv().License().Features.LDAPGroups && matched && !a.HasPermissionToChannel(post.UserId, post.ChannelId, model.PermissionUseGroupMentions) {
post.AddProp(model.PostPropsGroupHighlightDisabled, true)
}