From e31f76877fc39fe33cbadc48e4a75cc78f261b23 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 28 Sep 2010 15:05:56 +0000 Subject: [PATCH] Monotone-Parent: 13c390d039edb8ee59063c3d31ce0a34717725d7 Monotone-Revision: 0dce3171028377890b2c97a1af06a577c875930c Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-09-28T15:05:56 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ SoObjects/Mailer/SOGoMailFolder.h | 2 ++ SoObjects/Mailer/SOGoMailFolder.m | 21 ++++++++++++++++++++- 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8ccc98d20..8d7da08b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2010-09-28 Wolfgang Sourdeau + * SoObjects/Mailer/SOGoMailFolder.m (-displayName): fixed accessor + to return the real folder name rather than the nameInContainer, + which is escaped and prefixed with "folder". + (-create): new method intented to align the operations on this + class to the ones in SOGoGCSFolder. + * SoObjects/Contacts/SOGoContactGCSEntry.m (-displayName): new accessor. diff --git a/SoObjects/Mailer/SOGoMailFolder.h b/SoObjects/Mailer/SOGoMailFolder.h index 1be729e49..5e18ad095 100644 --- a/SoObjects/Mailer/SOGoMailFolder.h +++ b/SoObjects/Mailer/SOGoMailFolder.h @@ -72,6 +72,8 @@ - (void) markForExpunge; - (void) expungeLastMarkedFolder; +- (BOOL) create; + - (NSException *) expunge; /* flags */ diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index e34323650..75f1a95b8 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -697,6 +697,25 @@ static NSString *defaultUserID = @"anyone"; return [[self imap4Connection] createMailbox:_name atURL:[self imap4URL]]; } +- (BOOL) create +{ + NSException *error; + BOOL rc; + + [self imap4Connection]; + error = [imap4 createMailbox: [self relativeImap4Name] + atURL: [container imap4URL]]; + if (error) + rc = NO; + else + { + [[imap4 client] subscribe: [self absoluteImap4Name]]; + rc = YES; + } + + return rc; +} + - (NSException *) delete { return [[self imap4Connection] deleteMailboxAtURL:[self imap4URL]]; @@ -1140,7 +1159,7 @@ static NSString *defaultUserID = @"anyone"; - (NSString *) displayName { - return [self nameInContainer]; + return [self relativeImap4Name]; } - (NSDictionary *) davIMAPFieldsTable