Expunge drafts mailbox when a draft is sent

This commit is contained in:
Francis Lachapelle
2016-07-27 12:02:00 -04:00
parent 8545f89b2f
commit d95b90281b
2 changed files with 14 additions and 4 deletions
+1
View File
@@ -5,6 +5,7 @@ New features
- [eas] added folder merging capabilities
Enhancements
- [web] expunge drafts mailbox when a draft is sent and deleted
Bug fixes
- [eas] fixed long GUID issue preventing sometimes synchronisation (#3460)
+13 -4
View File
@@ -1,5 +1,5 @@
/*
Copyright (C) 2007-2014 Inverse inc.
Copyright (C) 2007-2016 Inverse inc.
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of SOGo.
@@ -15,7 +15,7 @@
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
License along with SOGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
@@ -73,6 +73,7 @@
#import "NSData+Mail.h"
#import "NSString+Mail.h"
#import "SOGoDraftsFolder.h"
#import "SOGoMailAccount.h"
#import "SOGoMailFolder.h"
#import "SOGoMailObject.h"
@@ -1979,8 +1980,16 @@ static NSString *userAgent = nil;
}
}
if (!error && ![dd mailKeepDraftsAfterSend])
[self delete];
// Expunge Drafts mailbox if
// - message was sent and saved to Sent mailbox if necessary;
// - SOGoMailKeepDraftsAfterSend is not set;
// - draft is successfully deleted;
// - drafts mailbox exists.
if (!error &&
![dd mailKeepDraftsAfterSend] &&
![self delete] &&
[imap4 doesMailboxExistAtURL: [container imap4URL]])
[(SOGoDraftsFolder *) container expunge];
return error;
}