Skip to content

Commit

Permalink
mailbox: Remove warning on missing file extension
Browse files Browse the repository at this point in the history
  • Loading branch information
martinhpedersen committed Sep 22, 2023
1 parent 707c6f9 commit 3837e64
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions mailbox/syncdir.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,6 @@ func LoadMessageDir(dirPath string) ([]*fbb.Message, error) {
continue
}

// Warn if we find a file that matches the old filename structure (TODO: Remove)
if isOldFilename(file.Name()) {
fmt.Fprintf(os.Stderr, "Mailbox: Ignoring message file with deprecated file name (%s). Fix manually by renaming the file to '%s'.\n", file.Name(), file.Name()+Ext)
continue
}

if !strings.EqualFold(filepath.Ext(file.Name()), Ext) {
continue
}
Expand All @@ -247,13 +241,6 @@ func LoadMessageDir(dirPath string) ([]*fbb.Message, error) {
return msgs, nil
}

func isOldFilename(str string) bool {
if len(str) > fbb.MaxMIDLength || filepath.Ext(str) != "" || strings.ContainsAny(str, "#~.") {
return false
}
return true
}

// OpenMessage opens a single a fbb.Message file.
func OpenMessage(path string) (*fbb.Message, error) {
f, err := os.Open(path)
Expand Down

0 comments on commit 3837e64

Please sign in to comment.