mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-11 13:16:53 +00:00
GODT-2233: Fix sub folder creation bug
Sub folders with more than 2 levels of depth (e.g.: Folders/first/second) could not be created since we did not update the known label list we use to validate the request.
This commit is contained in:
@ -125,7 +125,7 @@ func (conn *imapConnector) createLabel(ctx context.Context, name []string) (imap
|
||||
}
|
||||
|
||||
func (conn *imapConnector) createFolder(ctx context.Context, name []string) (imap.Mailbox, error) {
|
||||
return safe.RLockRetErr(func() (imap.Mailbox, error) {
|
||||
return safe.LockRetErr(func() (imap.Mailbox, error) {
|
||||
var parentID string
|
||||
|
||||
if len(name) > 1 {
|
||||
@ -154,6 +154,9 @@ func (conn *imapConnector) createFolder(ctx context.Context, name []string) (ima
|
||||
return imap.Mailbox{}, err
|
||||
}
|
||||
|
||||
// Add label to list so subsequent sub folder create requests work correct.
|
||||
conn.apiLabels[label.ID] = label
|
||||
|
||||
return toIMAPMailbox(label, conn.flags, conn.permFlags, conn.attrs), nil
|
||||
}, conn.apiLabelsLock)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user