mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-25 16:12:44 +00:00
Fixed bug #1944
Deleting a mail folder doesn't create the Trash mailbox.
This commit is contained in:
@@ -86,6 +86,8 @@
|
||||
|
||||
- (BOOL) create;
|
||||
|
||||
- (BOOL) ensureTrashFolder;
|
||||
|
||||
- (NSException *) expunge;
|
||||
|
||||
- (NSException *) renameTo: (NSString *) newName;
|
||||
|
||||
@@ -414,17 +414,15 @@ static NSString *defaultUserID = @"anyone";
|
||||
{
|
||||
// If our Trash folder doesn't exist when we try to copy messages
|
||||
// to it, we create it.
|
||||
result = [[client status: folderName flags: [NSArray arrayWithObject: @"UIDVALIDITY"]]
|
||||
objectForKey: @"result"];
|
||||
b = [self ensureTrashFolder];
|
||||
|
||||
if (![result boolValue])
|
||||
[imap4 createMailbox: folderName
|
||||
atURL: [[self mailAccountFolder] imap4URL]];
|
||||
if (b)
|
||||
{
|
||||
result = [[client copyUids: uids toFolder: folderName]
|
||||
objectForKey: @"result"];
|
||||
|
||||
result = [[client copyUids: uids toFolder: folderName]
|
||||
objectForKey: @"result"];
|
||||
|
||||
b = [result boolValue];
|
||||
b = [result boolValue];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -956,6 +954,24 @@ static NSString *defaultUserID = @"anyone";
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (BOOL) ensureTrashFolder
|
||||
{
|
||||
SOGoMailFolder *trashFolder;
|
||||
BOOL rc;
|
||||
|
||||
trashFolder = [[self mailAccountFolder] trashFolderInContext: context];
|
||||
rc = NO;
|
||||
if (![trashFolder isKindOfClass: [NSException class]])
|
||||
{
|
||||
rc = [trashFolder exists];
|
||||
if (!rc)
|
||||
rc = [trashFolder create];
|
||||
}
|
||||
if (!rc)
|
||||
[self errorWithFormat: @"Cannot create Trash Mailbox"];
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (NSException *) delete
|
||||
{
|
||||
NSException *error;
|
||||
|
||||
Reference in New Issue
Block a user