fixing merge
Этот коммит содержится в:
@@ -13,9 +13,9 @@ import (
|
||||
"github.com/mattermost/platform/model"
|
||||
"github.com/mattermost/platform/utils"
|
||||
"github.com/nfnt/resize"
|
||||
_ "golang.org/x/image/bmp"
|
||||
"image"
|
||||
_ "image/gif"
|
||||
_ "golang.org/x/image/bmp"
|
||||
"image/jpeg"
|
||||
"io"
|
||||
"net/http"
|
||||
@@ -157,7 +157,7 @@ func fireAndForgetHandleImages(filenames []string, fileData [][]byte, teamId, ch
|
||||
go func() {
|
||||
var thumbnail image.Image
|
||||
if imgConfig.Width > int(utils.Cfg.ImageSettings.ThumbnailWidth) {
|
||||
thumbnail = resize.Resize(utils.Cfg.ImageSettings.ThumbnailWidth, utils.Cfg.ImageSettings.ThumbnailHeight, img, resize.NearestNeighbor)
|
||||
thumbnail = resize.Resize(utils.Cfg.ImageSettings.ThumbnailWidth, utils.Cfg.ImageSettings.ThumbnailHeight, img, resize.Lanczos3)
|
||||
} else {
|
||||
thumbnail = img
|
||||
}
|
||||
@@ -182,7 +182,7 @@ func fireAndForgetHandleImages(filenames []string, fileData [][]byte, teamId, ch
|
||||
go func() {
|
||||
var preview image.Image
|
||||
if imgConfig.Width > int(utils.Cfg.ImageSettings.PreviewWidth) {
|
||||
preview = resize.Resize(utils.Cfg.ImageSettings.PreviewWidth, utils.Cfg.ImageSettings.PreviewHeight, img, resize.NearestNeighbor)
|
||||
preview = resize.Resize(utils.Cfg.ImageSettings.PreviewWidth, utils.Cfg.ImageSettings.PreviewHeight, img, resize.Lanczos3)
|
||||
} else {
|
||||
preview = img
|
||||
}
|
||||
|
||||
14
api/post.go
14
api/post.go
@@ -14,6 +14,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
func InitPost(r *mux.Router) {
|
||||
@@ -437,6 +438,19 @@ func fireAndForgetNotifications(post *model.Post, teamId, teamUrl string) {
|
||||
|
||||
message := model.NewMessage(teamId, post.ChannelId, post.UserId, model.ACTION_POSTED)
|
||||
message.Add("post", post.ToJson())
|
||||
|
||||
if len(post.Filenames) != 0 {
|
||||
message.Add("otherFile", "true")
|
||||
|
||||
for _, filename := range post.Filenames {
|
||||
ext := filepath.Ext(filename)
|
||||
if model.IsFileExtImage(ext) {
|
||||
message.Add("image", "true")
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(mentionedUsers) != 0 {
|
||||
message.Add("mentions", model.ArrayToJson(mentionedUsers))
|
||||
}
|
||||
|
||||
@@ -729,6 +729,8 @@ func uploadProfileImage(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
Srv.Store.User().UpdateUpdateAt(c.Session.UserId)
|
||||
|
||||
c.LogAudit("")
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user