[NO-TICKET] Remove unused function attributes (#16878)

Этот коммит содержится в:
Atanas Alexandrov
2021-02-08 10:11:07 +01:00
коммит произвёл GitHub
родитель 4a60cdaf4f
Коммит cda69d4dd7
4 изменённых файлов: 10 добавлений и 10 удалений

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

@@ -1026,7 +1026,7 @@ func (a *App) HandleImages(previewPathList []string, thumbnailPathList []string,
wg := new(sync.WaitGroup) wg := new(sync.WaitGroup)
for i := range fileData { for i := range fileData {
img, width, _ := prepareImage(fileData[i]) img, _, _ := prepareImage(fileData[i])
if img != nil { if img != nil {
wg.Add(2) wg.Add(2)
go func(img image.Image, path string) { go func(img image.Image, path string) {
@@ -1034,10 +1034,10 @@ func (a *App) HandleImages(previewPathList []string, thumbnailPathList []string,
a.generateThumbnailImage(img, path) a.generateThumbnailImage(img, path)
}(img, thumbnailPathList[i]) }(img, thumbnailPathList[i])
go func(img image.Image, path string, width int) { go func(img image.Image, path string) {
defer wg.Done() defer wg.Done()
a.generatePreviewImage(img, path, width) a.generatePreviewImage(img, path)
}(img, previewPathList[i], width) }(img, previewPathList[i])
} }
} }
wg.Wait() 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) preview := genPreview(img)
buf := new(bytes.Buffer) buf := new(bytes.Buffer)

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

@@ -89,7 +89,7 @@ type Actions struct {
CreateChannel func(*model.Channel, bool) (*model.Channel, *model.AppError) CreateChannel func(*model.Channel, bool) (*model.Channel, *model.AppError)
DoUploadFile func(time.Time, string, string, string, string, []byte) (*model.FileInfo, *model.AppError) DoUploadFile func(time.Time, string, string, string, string, []byte) (*model.FileInfo, *model.AppError)
GenerateThumbnailImage func(image.Image, string) GenerateThumbnailImage func(image.Image, string)
GeneratePreviewImage func(image.Image, string, int) GeneratePreviewImage func(image.Image, string)
InvalidateAllCaches func() InvalidateAllCaches func()
MaxPostSize func() int MaxPostSize func() int
PrepareImage func(fileData []byte) (image.Image, int, 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" { if fileInfo.IsImage() && fileInfo.MimeType != "image/svg+xml" {
img, width, _ := si.actions.PrepareImage(data) img, _, _ := si.actions.PrepareImage(data)
if img != nil { if img != nil {
si.actions.GenerateThumbnailImage(img, fileInfo.ThumbnailPath) 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 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 // This is for checking against locales like pt_BR or zn_CN
headerLocaleFull := strings.Split(r.Header.Get("Accept-Language"), ",")[0] headerLocaleFull := strings.Split(r.Header.Get("Accept-Language"), ",")[0]
// This is for checking against locales like en, es // 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() c.App.InitServer()
t, _ := utils.GetTranslationsAndLocale(w, r) t, _ := utils.GetTranslationsAndLocale(r)
c.App.SetT(t) c.App.SetT(t)
c.App.SetRequestId(requestID) c.App.SetRequestId(requestID)
c.App.SetIpAddress(utils.GetIpAddress(r, c.App.Config().ServiceSettings.TrustedProxyIPHeader)) c.App.SetIpAddress(utils.GetIpAddress(r, c.App.Config().ServiceSettings.TrustedProxyIPHeader))