Code generalization to be usable from the ActiveSync bundle

This commit is contained in:
Ludovic Marcotte
2014-01-10 14:08:12 -05:00
parent a4a3a735b4
commit e217ffb6c4
3 changed files with 22 additions and 8 deletions
+3 -3
View File
@@ -1,8 +1,6 @@
/* SOGoContactFolders.h - this file is part of SOGo
*
* Copyright (C) 2006, 2007 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Copyright (C) 2006-2013 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -31,6 +29,8 @@
withDisplayName: (NSString *) newDisplayName;
- (NSException *) removeLDAPAddressBook: (NSString *) sourceID;
- (NSDictionary *) systemSources;
@end
#endif /* SOGOCONTACTFOLDERS_H */
+12 -2
View File
@@ -110,8 +110,9 @@
return result;
}
- (NSException *) appendSystemSources
- (NSDictionary *) systemSources
{
NSMutableDictionary *systemSources;
SOGoUserManager *um;
SOGoSystemDefaults *sd;
NSEnumerator *sourceIDs, *domains;
@@ -119,6 +120,8 @@
SOGoContactSourceFolder *currentFolder;
SOGoUser *currentUser;
systemSources = [NSMutableDictionary dictionary];
if (! ([[context request] isIPhoneAddressBookApp] &&
![[context request] isAndroid]))
{
@@ -143,13 +146,20 @@
andDisplayName: srcDisplayName
inContainer: self];
[currentFolder setSource: [um sourceWithID: currentSourceID]];
[subFolders setObject: currentFolder forKey: currentSourceID];
[systemSources setObject: currentFolder forKey: currentSourceID];
}
domain = [domains nextObject];
}
}
}
return systemSources;
}
- (NSException *) appendSystemSources
{
[subFolders addEntriesFromDictionary: [self systemSources]];
return nil;
}
+7 -3
View File
@@ -1,8 +1,6 @@
/* SOGoContactGCSEntry.h - this file is part of SOGo
*
* Copyright (C) 2006-2012 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Copyright (C) 2006-2014 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -159,6 +157,12 @@
return result;
}
- (NSException *) saveComponent: (NGVCard *) newCard
{
ASSIGN(card, newCard);
return [self save];
}
- (NSException *) saveContentString: (NSString *) newContent
baseVersion: (unsigned int) newVersion
{