mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-14 19:31:22 +00:00
Monotone-Parent: 1e445a759baf03865aad01318b01c32c1c83c456
Monotone-Revision: 76b80b70d982a6797653b57df9258fed33df4bd9 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-10-26T14:26:01 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
16
ChangeLog
16
ChangeLog
@@ -1,3 +1,19 @@
|
||||
2007-10-26 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/MailerUI/UIxMailListView.m ([UIxMailListView
|
||||
-defaultAction]): now expunges the last folder marked for expunge.
|
||||
|
||||
* SoObjects/Mailer/SOGoMailObject.m ([SOGoMailObject
|
||||
-trashInContext:_ctx]): now marks the container folder for
|
||||
expunge.
|
||||
|
||||
* SoObjects/Mailer/SOGoMailFolder.m ([SOGoMailFolder
|
||||
-markForExpunge]): new method that marks the folder for the next
|
||||
automatic expunge operation in the user settings.
|
||||
([SOGoMailFolder -expungeLastMarkedFolder]): new methods that
|
||||
takes the last folder marked for expunge, expunges it and removes
|
||||
it from the user settings, if it exists.
|
||||
|
||||
2007-10-25 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/MailerUI/UIxMailListView.m ([UIxMailListView
|
||||
|
||||
@@ -52,6 +52,9 @@
|
||||
|
||||
- (NSException *) postData: (NSData *) _data flags: (id) _flags;
|
||||
|
||||
- (void) markForExpunge;
|
||||
- (void) expungeLastMarkedFolder;
|
||||
|
||||
- (NSException *) expunge;
|
||||
|
||||
/* flags */
|
||||
|
||||
@@ -19,9 +19,12 @@
|
||||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSURL.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
|
||||
#import <NGObjWeb/NSException+HTTP.h>
|
||||
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||
#import <NGExtensions/NSNull+misc.h>
|
||||
#import <NGExtensions/NSURL+misc.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
@@ -236,6 +239,47 @@ static NSString *defaultUserID = @"anyone";
|
||||
return [[self imap4Connection] expungeAtURL: [self imap4URL]];
|
||||
}
|
||||
|
||||
- (void) markForExpunge
|
||||
{
|
||||
NSUserDefaults *ud;
|
||||
NSMutableDictionary *mailSettings;
|
||||
|
||||
ud = [[context activeUser] userSettings];
|
||||
mailSettings = [ud objectForKey: @"Mail"];
|
||||
if (!mailSettings)
|
||||
{
|
||||
mailSettings = [NSMutableDictionary dictionaryWithCapacity: 1];
|
||||
[ud setObject: mailSettings forKey: @"Mail"];
|
||||
}
|
||||
|
||||
[mailSettings setObject: [self imap4URLString] forKey: @"folderForExpunge"];
|
||||
[ud synchronize];
|
||||
}
|
||||
|
||||
- (void) expungeLastMarkedFolder
|
||||
{
|
||||
NSUserDefaults *ud;
|
||||
NSMutableDictionary *mailSettings;
|
||||
NSString *expungeURL;
|
||||
NSURL *folderURL;
|
||||
|
||||
ud = [[context activeUser] userSettings];
|
||||
mailSettings = [ud objectForKey: @"Mail"];
|
||||
if (mailSettings)
|
||||
{
|
||||
expungeURL = [mailSettings objectForKey: @"folderForExpunge"];
|
||||
if (expungeURL)
|
||||
{
|
||||
folderURL = [NSURL URLWithString: expungeURL];
|
||||
if (![[self imap4Connection] expungeAtURL: folderURL])
|
||||
{
|
||||
[mailSettings removeObjectForKey: @"folderForExpunge"];
|
||||
[ud synchronize];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* flags */
|
||||
|
||||
- (NSException *) addFlagsToAllMessages: (id) _f
|
||||
|
||||
@@ -874,7 +874,9 @@ static BOOL debugSoParts = NO;
|
||||
|
||||
error = [[self imap4Connection] markURLDeleted: [self imap4URL]];
|
||||
if (error != nil) return error;
|
||||
|
||||
|
||||
[container markForExpunge];
|
||||
|
||||
[self flushMailCaches];
|
||||
|
||||
return nil;
|
||||
|
||||
@@ -516,10 +516,13 @@ static int attachmentFlagSize = 8096;
|
||||
{
|
||||
WORequest *request;
|
||||
NSString *specificMessage, *searchCriteria, *searchValue;
|
||||
SOGoUserFolder *co;
|
||||
|
||||
request = [context request];
|
||||
|
||||
[[self clientObject] flushMailCaches];
|
||||
co = [self clientObject];
|
||||
[co flushMailCaches];
|
||||
[co expungeLastMarkedFolder];
|
||||
|
||||
specificMessage = [request formValueForKey: @"pageforuid"];
|
||||
searchCriteria = [request formValueForKey: @"search"];
|
||||
@@ -532,6 +535,7 @@ static int attachmentFlagSize = 8096;
|
||||
= ((specificMessage)
|
||||
? [self firstMessageOfPageFor: [specificMessage intValue]]
|
||||
: [[request formValueForKey:@"idx"] intValue]);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user