+2008-01-18 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+
+ * SoObjects/Contacts/SOGoFolder+CardDAV.m ([SOGoFolder
+ -davAddressbookQuery:queryContext]): when empty values are fed to
+ SOGo, their dictionary should be explicitly set to nil.
+
2008-01-16 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/SOGoCache.m ([SOGoCache
+2008-01-21 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+
+ * GCSFolderManager.m ([GCSFolderManager
+ -baseTableNameWithUID:_uid]): the id was too long for the quick
+ tables, we reduce the length of the increment string to 3
+ characters instead of 8.
+
2008-01-16 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* GCSFolderManager.m ([GCSFolderManager -baseTableNameWithUID:]):
return [self folderForRecord:record];
}
-- (NSString *)baseTableNameWithUID:(NSString *)_uid {
+- (NSString *) baseTableNameWithUID: (NSString *) _uid
+{
unichar currentChar;
unsigned int count, max, done;
NSMutableString *newUID;
}
randInc++;
- return [NSString stringWithFormat: @"%@%.8x%.8x",
- newUID, randInc, (unsigned int) rand()];
+ return [NSString stringWithFormat: @"%@%.3x%.8x",
+ newUID, randInc & 0xfff, (unsigned int) rand()];
}
- (NSException *)createFolderOfType:(NSString *)_type
NSString *baseURL;
SOGoObject <SOGoContactFolder> *o;
- o = (id<SOGoContactFolder>)self;
+ o = (id <SOGoContactFolder>) self;
baseURL = [o baseURLInContext: localContext];
-
+
max = [filters count];
for (count = 0; count < max; count++)
{
objectEnumerator];
while ((contact = [contacts nextObject]))
- {
[o appendObject: contact
withBaseURL: baseURL
toREPORTResponse: response];
- }
}
}
- (BOOL) _isValidFilter: (NSString *) theString
{
- if ([theString caseInsensitiveCompare: @"sn"] == NSOrderedSame)
- return YES;
-
- if ([theString caseInsensitiveCompare: @"givenname"] == NSOrderedSame)
- return YES;
+ NSString *newString;
- if ([theString caseInsensitiveCompare: @"mail"] == NSOrderedSame)
- return YES;
+ newString = [theString lowercaseString];
- if ([theString caseInsensitiveCompare: @"telephonenumber"] == NSOrderedSame)
- return YES;
-
- return NO;
+ return ([theString isEqualToString: @"sn"]
+ || [theString isEqualToString: @"givenname"]
+ || [theString isEqualToString: @"mail"]
+ || [theString isEqualToString: @"telephonenumber"]);
}
- (NSDictionary *) _parseContactFilter: (id <DOMElement>) filterElement
id <DOMNode> parentNode;
id <DOMNodeList> ranges;
+ filterData = nil;
+
parentNode = [filterElement parentNode];
- if ([[parentNode tagName] isEqualToString: @"filter"] &&
- [self _isValidFilter: [filterElement attribute: @"name"]])
+ if ([[parentNode tagName] isEqualToString: @"filter"]
+ && [self _isValidFilter: [filterElement attribute: @"name"]])
{
ranges = [filterElement getElementsByTagName: @"text-match"];
-
- if ([(NSArray *)ranges count] && [(NSArray *)[[ranges objectAtIndex: 0] childNodes] count])
+
+ if ([(NSArray *) ranges count]
+ && [(NSArray *) [[ranges objectAtIndex: 0] childNodes] count])
{
filterData = [NSMutableDictionary new];
[filterData autorelease];
forKey: [filterElement attribute: @"name"]];
}
}
- else
- filterData = nil;
return filterData;
}
- (NSArray *) _parseContactFilters: (id <DOMElement>) parentNode
{
NSEnumerator *children;
- id<DOMElement> node;
+ id <DOMElement> node;
NSMutableArray *filters;
NSDictionary *filter;
- filters = [[NSMutableArray new] autorelease];
+ filters = [NSMutableArray array];
children = [[parentNode getElementsByTagName: @"prop-filter"]
objectEnumerator];
-
- node = [children nextObject];
-
- while (node)
+ while ((node = [children nextObject]))
{
filter = [self _parseContactFilter: node];
if (filter)
[filters addObject: filter];
- node = [children nextObject];
}
return filters;