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 ```
Этот коммит содержится в:
коммит произвёл
Claudio Costa
родитель
97ccf0bdf6
Коммит
f49b5dc440
@@ -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)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user