mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-04 12:58:50 +00:00
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:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user