mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[NO-TICKET] Remove unused function attributes (#16878)
This commit is contained in:
committed by
GitHub
parent
4a60cdaf4f
commit
cda69d4dd7
10
app/file.go
10
app/file.go
@@ -1026,7 +1026,7 @@ func (a *App) HandleImages(previewPathList []string, thumbnailPathList []string,
|
||||
wg := new(sync.WaitGroup)
|
||||
|
||||
for i := range fileData {
|
||||
img, width, _ := prepareImage(fileData[i])
|
||||
img, _, _ := prepareImage(fileData[i])
|
||||
if img != nil {
|
||||
wg.Add(2)
|
||||
go func(img image.Image, path string) {
|
||||
@@ -1034,10 +1034,10 @@ func (a *App) HandleImages(previewPathList []string, thumbnailPathList []string,
|
||||
a.generateThumbnailImage(img, path)
|
||||
}(img, thumbnailPathList[i])
|
||||
|
||||
go func(img image.Image, path string, width int) {
|
||||
go func(img image.Image, path string) {
|
||||
defer wg.Done()
|
||||
a.generatePreviewImage(img, path, width)
|
||||
}(img, previewPathList[i], width)
|
||||
a.generatePreviewImage(img, path)
|
||||
}(img, previewPathList[i])
|
||||
}
|
||||
}
|
||||
wg.Wait()
|
||||
@@ -1122,7 +1122,7 @@ func (a *App) generateThumbnailImage(img image.Image, thumbnailPath string) {
|
||||
}
|
||||
}
|
||||
|
||||
func (a *App) generatePreviewImage(img image.Image, previewPath string, width int) {
|
||||
func (a *App) generatePreviewImage(img image.Image, previewPath string) {
|
||||
preview := genPreview(img)
|
||||
|
||||
buf := new(bytes.Buffer)
|
||||
|
||||
@@ -89,7 +89,7 @@ type Actions struct {
|
||||
CreateChannel func(*model.Channel, bool) (*model.Channel, *model.AppError)
|
||||
DoUploadFile func(time.Time, string, string, string, string, []byte) (*model.FileInfo, *model.AppError)
|
||||
GenerateThumbnailImage func(image.Image, string)
|
||||
GeneratePreviewImage func(image.Image, string, int)
|
||||
GeneratePreviewImage func(image.Image, string)
|
||||
InvalidateAllCaches func()
|
||||
MaxPostSize func() int
|
||||
PrepareImage func(fileData []byte) (image.Image, int, int)
|
||||
@@ -771,10 +771,10 @@ func (si *SlackImporter) oldImportFile(timestamp time.Time, file io.Reader, team
|
||||
}
|
||||
|
||||
if fileInfo.IsImage() && fileInfo.MimeType != "image/svg+xml" {
|
||||
img, width, _ := si.actions.PrepareImage(data)
|
||||
img, _, _ := si.actions.PrepareImage(data)
|
||||
if img != nil {
|
||||
si.actions.GenerateThumbnailImage(img, fileInfo.ThumbnailPath)
|
||||
si.actions.GeneratePreviewImage(img, fileInfo.PreviewPath, width)
|
||||
si.actions.GeneratePreviewImage(img, fileInfo.PreviewPath)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ func GetUserTranslations(locale string) i18n.TranslateFunc {
|
||||
return translations
|
||||
}
|
||||
|
||||
func GetTranslationsAndLocale(w http.ResponseWriter, r *http.Request) (i18n.TranslateFunc, string) {
|
||||
func GetTranslationsAndLocale(r *http.Request) (i18n.TranslateFunc, string) {
|
||||
// This is for checking against locales like pt_BR or zn_CN
|
||||
headerLocaleFull := strings.Split(r.Header.Get("Accept-Language"), ",")[0]
|
||||
// This is for checking against locales like en, es
|
||||
|
||||
@@ -108,7 +108,7 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
)
|
||||
c.App.InitServer()
|
||||
|
||||
t, _ := utils.GetTranslationsAndLocale(w, r)
|
||||
t, _ := utils.GetTranslationsAndLocale(r)
|
||||
c.App.SetT(t)
|
||||
c.App.SetRequestId(requestID)
|
||||
c.App.SetIpAddress(utils.GetIpAddress(r, c.App.Config().ServiceSettings.TrustedProxyIPHeader))
|
||||
|
||||
Reference in New Issue
Block a user