diff --git a/mattermost-plugin/product/boards_product.go b/mattermost-plugin/product/boards_product.go index b65cda53a..374ad2156 100644 --- a/mattermost-plugin/product/boards_product.go +++ b/mattermost-plugin/product/boards_product.go @@ -10,7 +10,6 @@ import ( "github.com/mattermost/focalboard/mattermost-plugin/server/boards" "github.com/mattermost/focalboard/server/model" - "github.com/mattermost/mattermost-server/v6/app" "github.com/mattermost/mattermost-server/v6/einterfaces" mm_model "github.com/mattermost/mattermost-server/v6/model" "github.com/mattermost/mattermost-server/v6/plugin" diff --git a/server/app/files.go b/server/app/files.go index c2a5d7ff5..081b78e14 100644 --- a/server/app/files.go +++ b/server/app/files.go @@ -72,7 +72,11 @@ func (a *App) GetFileInfo(filename string) (*mmModel.FileInfo, error) { return nil, errEmptyFilename } - fileInfoID := utils.GetFileInfoFromFilename(filename) + // filename is in the format 7. + // we want to extract the part of this as this + // will be the fileinfo id. + parts := strings.Split(filename, ".") + fileInfoID := parts[0][1:] fileInfo, err := a.store.GetFileInfo(fileInfoID) if err != nil { return nil, err diff --git a/server/utils/utils.go b/server/utils/utils.go index 0f48f1155..995c2cc87 100644 --- a/server/utils/utils.go +++ b/server/utils/utils.go @@ -3,7 +3,6 @@ package utils import ( "encoding/json" "reflect" - "strings" "time" mmModel "github.com/mattermost/mattermost-server/v6/model" @@ -103,20 +102,3 @@ func IsCloudLicense(license *mmModel.License) bool { license.Features.Cloud != nil && *license.Features.Cloud } - -// GetFileInfoFromFilename strips the initial 7 from the filename as -// it is in the format 7., -// extracting the which corresponds to the -// fileinfo id. -func GetFileInfoFromFilename(filename string) string { - if !strings.HasPrefix(filename, "7") { - return filename - } - - parts := strings.Split(filename, ".") - if len(parts) != 2 { - return filename - } - - return parts[0][1:] -}