mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-09-27 16:10:35 +00:00
bugFix#2823
This commit is contained in:
@@ -1761,26 +1761,26 @@ static NSString *userAgent = nil;
|
||||
{
|
||||
SOGoUserDefaults *ud;
|
||||
ud = [[context activeUser] userDefaults];
|
||||
|
||||
|
||||
if ([ud mailAddOutgoingAddresses])
|
||||
{
|
||||
Class contactGCSEntry;
|
||||
SOGoContactFolders *contactFolders;
|
||||
NGMailAddressParser *parser;
|
||||
id parsedRecipient;
|
||||
SOGoContactFolder *folder;
|
||||
SOGoContactGCSEntry *newContact;
|
||||
NGVCard *card;
|
||||
Class contactGCSEntry;
|
||||
NGMailAddressParser *parser;
|
||||
NSArray *matchingContacts;
|
||||
NSMutableArray *recipients;
|
||||
NSString *recipient, *emailAddress, *addressBook, *uid;
|
||||
NSArray *matchingContacts;
|
||||
id parsedRecipient;
|
||||
int i;
|
||||
|
||||
|
||||
// Get all the addressbooks
|
||||
contactFolders = [[[context activeUser] homeFolderInContext: context]
|
||||
lookupName: @"Contacts"
|
||||
inContext: context
|
||||
acquire: NO];
|
||||
lookupName: @"Contacts"
|
||||
inContext: context
|
||||
acquire: NO];
|
||||
// Get all the recipients from the current email
|
||||
recipients = [self allRecipients];
|
||||
for (i = 0; i < [recipients count]; i++)
|
||||
@@ -1790,7 +1790,7 @@ static NSString *userAgent = nil;
|
||||
parser = [NGMailAddressParser mailAddressParserWithString: recipient];
|
||||
parsedRecipient = [parser parse];
|
||||
emailAddress = [parsedRecipient address];
|
||||
|
||||
|
||||
matchingContacts = [contactFolders allContactsFromFilter: emailAddress
|
||||
excludeGroups: YES
|
||||
excludeLists: YES];
|
||||
|
||||
@@ -164,34 +164,45 @@ static SoSecurityManager *sm = nil;
|
||||
NSString *folderName;
|
||||
SOGoGCSFolder *folder;
|
||||
SOGoUser *folderOwner;
|
||||
|
||||
SOGoUserDefaults *ud;
|
||||
|
||||
roles = [[context activeUser] rolesForObject: self inContext: context];
|
||||
folderOwner = [SOGoUser userWithLogin: [self ownerInContext: context]];
|
||||
|
||||
|
||||
|
||||
// We autocreate the calendars if the user is the owner, a superuser or
|
||||
// if it's a resource as we won't necessarily want to login as a resource
|
||||
// in order to create its database tables.
|
||||
// FolderType is an enum where 0 = Personal and 1 = collected
|
||||
if ([roles containsObject: SoRole_Owner] ||
|
||||
(folderOwner && [folderOwner isResource]))
|
||||
{
|
||||
if (folderType == SOGoPersonalFolder)
|
||||
{
|
||||
if (folderType == SOGoPersonalFolder)
|
||||
{
|
||||
folderName = @"personal";
|
||||
folder = [subFolderClass objectWithName: folderName inContainer: self];
|
||||
[folder setDisplayName: [self defaultFolderName]];
|
||||
}
|
||||
else if (folderType == SOGoCollectedFolder)
|
||||
{
|
||||
folderName = @"collected";
|
||||
folder = [subFolderClass objectWithName: folderName inContainer: self];
|
||||
[folder setDisplayName: [self collectedFolderName]];
|
||||
}
|
||||
folderName = @"personal";
|
||||
folder = [subFolderClass objectWithName: folderName inContainer: self];
|
||||
[folder setDisplayName: [self defaultFolderName]];
|
||||
[folder setOCSPath: [NSString stringWithFormat: @"%@/%@", OCSPath, folderName]];
|
||||
|
||||
if ([folder create])
|
||||
[subFolders setObject: folder forKey: folderName];
|
||||
[subFolders setObject: folder forKey: folderName];
|
||||
}
|
||||
else if (folderType == SOGoCollectedFolder)
|
||||
{
|
||||
ud = [[context activeUser] userDefaults];
|
||||
if ([ud mailAddOutgoingAddresses]) {
|
||||
folderName = @"collected";
|
||||
folder = [subFolderClass objectWithName: folderName inContainer: self];
|
||||
[folder setDisplayName: [self collectedFolderName]];
|
||||
[folder setOCSPath: [NSString stringWithFormat: @"%@/%@", OCSPath, folderName]];
|
||||
|
||||
if ([folder create])
|
||||
[subFolders setObject: folder forKey: folderName];
|
||||
|
||||
[ud setSelectedAddressBook:folderName];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (NSException *) fetchSpecialFolders: (NSString *) sql
|
||||
|
||||
Reference in New Issue
Block a user