mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-11-21 15:02:40 +00:00
Use address books search fields in Contacts module
Searches can now be scoped to one or multiple fields. Those fields are now dynamic and can be defined using SearchFieldNames in external contacts sources (SQL and LDAP).
This commit is contained in:
1 parent
aed62cab26
commit
eb90760b39
19 files changed
+275
-137
No files matched your search
@@ -115,6 +115,11 @@
|
||||
return isPersonalSource;
|
||||
}
|
||||
|
||||
- (NSArray *) searchFields
|
||||
{
|
||||
return [source searchFields];
|
||||
}
|
||||
|
||||
- (BOOL) listRequiresDot
|
||||
{
|
||||
return [source listRequiresDot];
|
||||
@@ -391,7 +396,7 @@
|
||||
}
|
||||
|
||||
- (NSArray *) lookupContactsWithFilter: (NSString *) filter
|
||||
onCriteria: (NSString *) criteria
|
||||
onCriteria: (NSArray *) criteria
|
||||
sortBy: (NSString *) sortKey
|
||||
ordering: (NSComparisonResult) sortOrdering
|
||||
inDomain: (NSString *) domain
|
||||
@@ -401,10 +406,10 @@
|
||||
|
||||
result = nil;
|
||||
|
||||
if (([filter length] > 0 && [criteria isEqualToString: @"name_or_address"])
|
||||
|| ![source listRequiresDot])
|
||||
if ([filter length] > 0 || ![source listRequiresDot])
|
||||
{
|
||||
records = [source fetchContactsMatching: filter
|
||||
withCriteria: criteria
|
||||
inDomain: domain];
|
||||
[childRecords setObjects: records
|
||||
forKeys: [records objectsForKey: @"c_name"
|
||||
|
||||
Reference in new issue
Block a user