From 2692f3746b932f1a4244fbcbd3c961b8a5bb5a3b Mon Sep 17 00:00:00 2001 From: helge Date: Mon, 28 May 2007 12:44:57 +0000 Subject: [PATCH] some fix for bug 1875 git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1485 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-mime/ChangeLog | 4 ++ sope-mime/NGImap4/ChangeLog | 5 +++ sope-mime/NGImap4/NGImap4ResponseNormalizer.m | 38 ++++++++++++++----- sope-mime/Version | 2 +- 4 files changed, 39 insertions(+), 10 deletions(-) diff --git a/sope-mime/ChangeLog b/sope-mime/ChangeLog index b0536d22..83519a8d 100644 --- a/sope-mime/ChangeLog +++ b/sope-mime/ChangeLog @@ -1,3 +1,7 @@ +2007-05-28 Helge Hess + + * NGImap4: changed behaviour wrt bug 1875 (v4.7.244) + 2007-02-12 Helge Hess * NGImap4: fixed a gstep-base compilation warning (v4.7.243) diff --git a/sope-mime/NGImap4/ChangeLog b/sope-mime/NGImap4/ChangeLog index 86c26763..cf1a60b5 100644 --- a/sope-mime/NGImap4/ChangeLog +++ b/sope-mime/NGImap4/ChangeLog @@ -1,3 +1,8 @@ +2007-05-28 Helge Hess + + * NGImap4ResponseNormalizer.m: changed not to throw an exception in the + situation described in OGo bug 1875 + 2007-02-12 Helge Hess * NGImap4Functions.m, NGSieveClient.m: fixed a gstep-base compilation diff --git a/sope-mime/NGImap4/NGImap4ResponseNormalizer.m b/sope-mime/NGImap4/NGImap4ResponseNormalizer.m index 7ca2d153..dfe4cf1a 100644 --- a/sope-mime/NGImap4/NGImap4ResponseNormalizer.m +++ b/sope-mime/NGImap4/NGImap4ResponseNormalizer.m @@ -1,5 +1,6 @@ /* - Copyright (C) 2000-2005 SKYRIX Software AG + Copyright (C) 2000-2007 SKYRIX Software AG + Copyright (C) 2007 Helge Hess This file is part of SOPE. @@ -201,6 +202,20 @@ static int LogImapEnabled = -1; flags : NSArray unseen : NSNumber access : NSString ([READ-WRITE], ... ) + + Eg: + 17 select "INBOX" + * FLAGS (\Answered \Flagged \Draft \Deleted \Seen) + * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen \*)] + * OK (seen state failure) Unable to preserve \Seen state: System I/O \ + error + * 0 EXISTS + * 0 RECENT + * OK [UIDVALIDITY 1016867500] + * OK [UIDNEXT 18948] + * OK [NOMODSEQ] Sorry, modsequences have not been enabled on this \ + mailbox + 17 OK [READ-WRITE] Completed */ NSDictionary *obj; NSEnumerator *enumerator; @@ -209,28 +224,33 @@ static int LogImapEnabled = -1; result = [self normalizeResponse:_map]; - if ((flags = [[_map objectEnumeratorForKey:@"flags"] nextObject])) + if ((flags = [[_map objectEnumeratorForKey:@"flags"] nextObject]) != nil) [result setObject:_imapFlags2Flags(self, flags) forKey:@"flags"]; + // TODO: document the contents of this dictionary enumerator = [_map objectEnumeratorForKey:@"ok"]; - while ((obj = [enumerator nextObject])) { + while ((obj = [enumerator nextObject]) != nil) { id o; - if ((o = [obj objectForKey:@"unseen"])) - [result setObject:o forKey:@"unseen"]; + if ([obj isKindOfClass:DictClass]) { + if ((o = [obj objectForKey:@"unseen"])) + [result setObject:o forKey:@"unseen"]; + } + else + [self warnWithFormat:@"unexpected OK object: %@", obj]; } enumerator = [_map objectEnumeratorForKey:@"no"]; - while ((obj = [enumerator nextObject])) { + while ((obj = [enumerator nextObject]) != nil) { id o; + // TODO: document this if ([obj isKindOfClass:DictClass]) { - if ((o = [obj objectForKey:@"ALERT"])) + if ((o = [obj objectForKey:@"ALERT"]) != nil) [result setObject:o forKey:@"alert"]; } - else { + else // TODO: this looks wrong, its not safe that this is the ALERT result? [result setObject:obj forKey:@"alert"]; - } } obj = [_map objectForKey:@"ResponseResult"]; diff --git a/sope-mime/Version b/sope-mime/Version index 20bbd922..5afd1539 100644 --- a/sope-mime/Version +++ b/sope-mime/Version @@ -2,7 +2,7 @@ MAJOR_VERSION:=4 MINOR_VERSION:=7 -SUBMINOR_VERSION:=242 +SUBMINOR_VERSION:=244 # v4.5.214 requires libNGExtensions v4.5.146 # v4.2.149 requires libNGStreams v4.2.34 -- 2.39.5