pull/29/head
Alexandre Cloutier 2014-04-07 10:59:38 -04:00
parent 03d5975be3
commit 09bcd2aee2
3 changed files with 12 additions and 10 deletions

View File

@ -1731,18 +1731,20 @@ static NSString *userAgent = nil;
matchingContacts = [contactFolders allContactsFromFilter: emailAddress
excludeGroups: YES
excludeLists: YES];
}
// If we don't get any results from the autocompletion code, we add it..
if ([matchingContacts count] == 0)
{
/* Get the selected addressbook from the user preferences where the new address will be added */
addressBook = [ud selectedAddressBook];
folder = [contactFolders lookupName: addressBook inContext: context acquire: NO];
uid = [folder globallyUniqueObjectId];
// If we don't get any results from the autocompletion code, we add it..
if ([matchingContacts count] == 0)
if (!(folder == nil || uid == nil))
{
/* Get the selected addressbook from the user preferences where the new address will be added */
addressBook = [ud selectedAddressBook];
folder = [contactFolders lookupName: addressBook inContext: context acquire: NO];
uid = [folder globallyUniqueObjectId];
card = [NGVCard cardWithUid: uid];
[card addEmail: emailAddress types: nil];
contactGCSEntry = NSClassFromString(@"SOGoContactGCSEntry");
newContact = [contactGCSEntry objectWithName: uid
inContainer: folder];

View File

@ -171,7 +171,7 @@ static SoSecurityManager *sm = nil;
// 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
// FolderType is an enum where 0 = Personal and 1 = collected
if ([roles containsObject: SoRole_Owner] ||
(folderOwner && [folderOwner isResource]))
{

View File

@ -717,7 +717,7 @@ static NSArray *reminderValues = nil;
count = [folders count]-1;
collectedAlreadyExist = false;
for (i=0; i <= count ; i++) {
for (i = 0; i <= count ; i++) {
[availableAddressBooksID addObject:[[folders objectAtIndex:i] realNameInContainer]];
[availableAddressBooksName addObject:[[folders objectAtIndex:i] displayName]];