Monotone-Parent: 1446e7383727bc0d371dfafcec06697f030f7117

Monotone-Revision: 7f4c04f0c1883efb437cd0189f442b20c0063c82

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-02-20T19:47:58
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2012-02-20 19:47:58 +00:00
parent 04e09e0b61
commit 18eab08165
10 changed files with 121 additions and 14 deletions

View File

@@ -34,7 +34,7 @@
#import <SOGo/SOGoPermissions.h>
#import <SOGo/SOGoUser.h>
#import "MAPIStoreContext.h"
#import "MAPIStoreGCSBaseContext.h"
#import "MAPIStoreTypes.h"
#import "MAPIStoreUserContext.h"
#import "NSData+MAPIStore.h"
@@ -102,6 +102,44 @@
return (rc == MAPISTORE_SUCCESS) ? [super deleteFolder] : rc;
}
- (void) setDisplayName: (NSString *) newDisplayName
{
NSString *suffix, *fullSuffix;
Class cClass;
cClass = [(MAPIStoreGCSBaseContext *) [self context] class];
/* if a suffix exists, we strip it from the final name */
suffix = [cClass folderNameSuffix];
if ([suffix length] > 0)
{
fullSuffix = [NSString stringWithFormat: @"(%@)", suffix];
if ([newDisplayName hasSuffix: fullSuffix])
{
newDisplayName = [newDisplayName substringToIndex:
[newDisplayName length]
- [fullSuffix length]];
newDisplayName = [newDisplayName stringByTrimmingSpaces];
}
}
if (![[sogoObject displayName] isEqualToString: newDisplayName])
[sogoObject renameTo: newDisplayName];
}
- (int) getPrDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *displayName;
Class cClass;
cClass = [(MAPIStoreGCSBaseContext *) [self context] class];
displayName = [cClass getFolderDisplayName: [sogoObject displayName]];
*data = [displayName asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (void) addProperties: (NSDictionary *) newProperties
{
NSString *newDisplayName;
@@ -112,7 +150,7 @@
newDisplayName = [newProperties objectForKey: key];
if (newDisplayName)
{
[sogoObject renameTo: newDisplayName];
[self setDisplayName: newDisplayName];
propsCopy = [newProperties mutableCopy];
[propsCopy removeObjectForKey: key];
[propsCopy autorelease];