diff options
| author | Bobby <[email protected]> | 2025-12-24 12:44:33 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2025-12-24 12:44:33 +0530 |
| commit | 81ab367f440d6f85297b2013d0c1aa57fda7e9cd (patch) | |
| tree | 823a55ba7416d6df86e88bfdfad7925904c0c565 /repository | |
| parent | 62cf64c4216a527334d4b9c312d144aaeec27ff9 (diff) | |
| download | lain-81ab367f440d6f85297b2013d0c1aa57fda7e9cd.tar.xz lain-81ab367f440d6f85297b2013d0c1aa57fda7e9cd.zip | |
refactor: Exclude virtual IMAP folders from processing and standardize template formatting.
Diffstat (limited to 'repository')
| -rw-r--r-- | repository/folders.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/repository/folders.go b/repository/folders.go index 0da58e0..20dcaa2 100644 --- a/repository/folders.go +++ b/repository/folders.go @@ -266,6 +266,10 @@ func syncFolders(userEmail string) error { foldersByName := make(map[string]uint) for i, imapFolder := range imapFolders { + if strings.HasPrefix(imapFolder.Name, "Virtual") || strings.Contains(imapFolder.Name, "/Virtual") { + continue + } + var folder models.Folder imapNameLower := strings.ToLower(imapFolder.Name) result := database.DB.Where("user_email = ? AND LOWER(imap_name) = ?", userEmail, imapNameLower).First(&folder) @@ -296,6 +300,10 @@ func syncFolders(userEmail string) error { } for _, imapFolder := range imapFolders { + if strings.HasPrefix(imapFolder.Name, "Virtual") || strings.Contains(imapFolder.Name, "/Virtual") { + continue + } + if strings.Contains(imapFolder.Name, "/") { parts := strings.Split(imapFolder.Name, "/") if len(parts) > 1 { |
