Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2022-03-29 12:44:52 +03:00
коммит произвёл GitHub
родитель 773ec991a8
Коммит a4a6fe0a94
3 изменённых файлов: 13 добавлений и 0 удалений

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

@@ -215,6 +215,10 @@ func NewChannels(s *Server, services map[ServiceKey]interface{}) (*Channels, err
pluginsRoute.HandleFunc("/public/{public_file:.*}", ch.ServePluginPublicRequest)
pluginsRoute.HandleFunc("/{anything:.*}", ch.ServePluginRequest)
services[PostKey] = &postServiceWrapper{
app: &App{ch: ch},
}
return ch, nil
}

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

@@ -32,6 +32,14 @@ const (
var atMentionPattern = regexp.MustCompile(`\B@`)
type postServiceWrapper struct {
app AppIface
}
func (s *postServiceWrapper) CreatePost(ctx *request.Context, post *model.Post) (*model.Post, *model.AppError) {
return s.app.CreatePostMissingChannel(ctx, post, true)
}
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)

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

@@ -94,6 +94,7 @@ const (
LicenseKey ServiceKey = "license"
FilestoreKey ServiceKey = "filestore"
ClusterKey ServiceKey = "cluster"
PostKey ServiceKey = "post"
)
type Server struct {