From 5823cdfa4cc07096bd73a445254aaac16641b655 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 28 Aug 2008 21:25:02 +0000 Subject: [PATCH] Monotone-Parent: 5966d179f5ba5866b985546c60bf56fb8c81da28 Monotone-Revision: fd131f17ab49c14614952e0ede565d75240108d4 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-08-28T21:25:02 Monotone-Branch: ca.inverse.sogo --- SOPE/sope-patchset-r1626.diff | 46 ++++++++++++++++++++++++++----- SoObjects/Mailer/SOGoMailFolder.h | 1 + SoObjects/Mailer/SOGoMailFolder.m | 10 +++++++ UI/MailerUI/UIxMailView.m | 4 +++ 4 files changed, 54 insertions(+), 7 deletions(-) diff --git a/SOPE/sope-patchset-r1626.diff b/SOPE/sope-patchset-r1626.diff index cb1fd5754..e1567e9d8 100644 --- a/SOPE/sope-patchset-r1626.diff +++ b/SOPE/sope-patchset-r1626.diff @@ -189,7 +189,15 @@ Index: sope-mime/NGImap4/NGImap4Client.h =================================================================== --- sope-mime/NGImap4/NGImap4Client.h (révision 1626) +++ sope-mime/NGImap4/NGImap4Client.h (copie de travail) -@@ -138,7 +138,7 @@ +@@ -120,6 +120,7 @@ + - (NSDictionary *)list:(NSString *)_folder pattern:(NSString *)_pattern; + - (NSDictionary *)lsub:(NSString *)_folder pattern:(NSString *)_pattern; + - (NSDictionary *)select:(NSString *)_folder; ++- (NSDictionary *)unselect; + - (NSDictionary *)status:(NSString *)_folder flags:(NSArray *)_flags; + - (NSDictionary *)rename:(NSString *)_folder to:(NSString *)_newName; + - (NSDictionary *)delete:(NSString *)_folder; +@@ -138,7 +139,7 @@ flags:(NSArray *)_flags; - (NSDictionary *)storeFrom:(unsigned)_from to:(unsigned)_to add:(NSNumber *)_add flags:(NSArray *)_flags; @@ -247,7 +255,18 @@ Index: sope-mime/NGImap4/NGImap4Client.m @end /* -@@ -820,23 +824,23 @@ +@@ -635,6 +639,10 @@ + return [self->normer normalizeSelectResponse:[self processCommand:s]]; + } + ++- (NSDictionary *)unselect { ++ return [self->normer normalizeResponse:[self processCommand:@"unselect"]]; ++} ++ + - (NSDictionary *)status:(NSString *)_folder flags:(NSArray *)_flags { + NSString *cmd; + +@@ -820,23 +828,23 @@ return [self->normer normalizeResponse:[self processCommand:cmd]]; } @@ -277,7 +296,7 @@ Index: sope-mime/NGImap4/NGImap4Client.m seqstr, _flag ? '+' : '-', flagstr]; return [self->normer normalizeResponse:[self processCommand:cmd]]; -@@ -967,11 +971,12 @@ +@@ -967,11 +975,12 @@ descr = @"Could not process qualifier for imap search "; descr = [descr stringByAppendingString:reason]; @@ -293,7 +312,7 @@ Index: sope-mime/NGImap4/NGImap4Client.m } - (NSString *)_searchExprForQual:(EOQualifier *)_qualifier { -@@ -1093,7 +1098,18 @@ +@@ -1093,7 +1102,18 @@ Eg: UID SORT ( DATE REVERSE SUBJECT ) UTF-8 TODO */ NSString *tmp; @@ -312,7 +331,7 @@ Index: sope-mime/NGImap4/NGImap4Client.m if ([_sortSpec isKindOfClass:[NSArray class]]) tmp = [self _generateIMAP4SortOrderings:_sortSpec]; else if ([_sortSpec isKindOfClass:[EOSortOrdering class]]) -@@ -1107,9 +1123,10 @@ +@@ -1107,9 +1127,10 @@ tmp = @"DATE"; } @@ -325,7 +344,7 @@ Index: sope-mime/NGImap4/NGImap4Client.m } - (NSDictionary *)sort:(NSArray *)_sortOrderings qualifier:(EOQualifier *)_qual -@@ -1130,7 +1147,7 @@ +@@ -1130,7 +1151,7 @@ return nil; } @@ -334,7 +353,7 @@ Index: sope-mime/NGImap4/NGImap4Client.m return [self->normer normalizeSearchResponse:[self processCommand:s]]; } -@@ -1193,6 +1210,79 @@ +@@ -1193,6 +1214,79 @@ /* Private Methods */ @@ -687,6 +706,19 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m - (NSException *)exceptionForFailedMatch:(unsigned char)_match got:(unsigned char)_avail { +Index: sope-mime/NGImap4/ChangeLog +=================================================================== +--- sope-mime/NGImap4/ChangeLog (révision 1626) ++++ sope-mime/NGImap4/ChangeLog (copie de travail) +@@ -1,3 +1,8 @@ ++2008-08-28 Wolfgang Sourdeau ++ ++ * NGImap4Client.m ([NGImap -unselect]): new method to send ++ "UNSELECT" to the imap server. ++ + 2007-08-24 Wolfgang Sourdeau + + * NGImap4Connection.m: some fix for folders ending with a slash (OGo Index: sope-mime/NGMail/NGSmtpClient.m =================================================================== --- sope-mime/NGMail/NGSmtpClient.m (révision 1626) diff --git a/SoObjects/Mailer/SOGoMailFolder.h b/SoObjects/Mailer/SOGoMailFolder.h index 49e1fe654..a269f8b44 100644 --- a/SoObjects/Mailer/SOGoMailFolder.h +++ b/SoObjects/Mailer/SOGoMailFolder.h @@ -64,6 +64,7 @@ typedef enum { - (void) expungeLastMarkedFolder; - (NSException *) expunge; +- (NSException *) unselect; /* flags */ diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index 43886de3e..fb3f4133f 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -283,6 +283,16 @@ static BOOL aclConformsToIMAPExt = NO; return [[self imap4Connection] expungeAtURL: [self imap4URL]]; } +- (NSException *) unselect +{ + NGImap4Client *client; + + client = [[self imap4Connection] client]; + [client unselect]; + + return nil; +} + - (void) markForExpunge { NSUserDefaults *ud; diff --git a/UI/MailerUI/UIxMailView.m b/UI/MailerUI/UIxMailView.m index acd1a0b2e..4b3f2cda5 100644 --- a/UI/MailerUI/UIxMailView.m +++ b/UI/MailerUI/UIxMailView.m @@ -209,6 +209,7 @@ static NSString *mailETag = nil; inContext: (WOContext *) _ctx { UIxMailRenderingContext *mctx; + SOGoMailFolder *mailFolder; if (mailETag != nil) [[_ctx response] setHeader:mailETag forKey:@"etag"]; @@ -222,6 +223,9 @@ static NSString *mailETag = nil; [super appendToResponse: _response inContext: _ctx]; [[_ctx popMailRenderingContext] reset]; + + mailFolder = [[self clientObject] container]; + [mailFolder unselect]; } @end /* UIxMailView */