mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-22 06:42:44 +00:00
Fixed bug #1944
Deleting a mail folder doesn't create the Trash mailbox.
This commit is contained in:
@@ -153,26 +153,34 @@
|
||||
NSURL *srcURL, *destURL;
|
||||
|
||||
co = [self clientObject];
|
||||
connection = [co imap4Connection];
|
||||
srcURL = [co imap4URL];
|
||||
destURL = [self _trashedURLOfFolder: srcURL withCO: co];
|
||||
connection = [co imap4Connection];
|
||||
inbox = [[co mailAccountFolder] inboxFolderInContext: context];
|
||||
[[connection client] select: [inbox absoluteImap4Name]];
|
||||
error = [connection moveMailboxAtURL: srcURL toURL: destURL];
|
||||
if (error)
|
||||
{
|
||||
response = [self responseWithStatus: 500];
|
||||
[response appendContentString: @"Unable to move folder."];
|
||||
}
|
||||
if ([co ensureTrashFolder])
|
||||
{
|
||||
connection = [co imap4Connection];
|
||||
srcURL = [co imap4URL];
|
||||
destURL = [self _trashedURLOfFolder: srcURL withCO: co];
|
||||
connection = [co imap4Connection];
|
||||
inbox = [[co mailAccountFolder] inboxFolderInContext: context];
|
||||
[[connection client] select: [inbox absoluteImap4Name]];
|
||||
error = [connection moveMailboxAtURL: srcURL toURL: destURL];
|
||||
if (error)
|
||||
{
|
||||
response = [self responseWithStatus: 500];
|
||||
[response appendContentString: @"Unable to move folder."];
|
||||
}
|
||||
else
|
||||
{
|
||||
// We unsubscribe to the old one, and subscribe back to the new one
|
||||
[[connection client] subscribe: [destURL path]];
|
||||
[[connection client] unsubscribe: [srcURL path]];
|
||||
|
||||
response = [self responseWith204];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// We unsubscribe to the old one, and subscribe back to the new one
|
||||
[[connection client] subscribe: [destURL path]];
|
||||
[[connection client] unsubscribe: [srcURL path]];
|
||||
|
||||
response = [self responseWith204];
|
||||
}
|
||||
{
|
||||
response = [self responseWithStatus: 500];
|
||||
[response appendContentString: @"Unable to move folder."];
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user