mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-02 10:05:26 +00:00
fix(addressbook): autocomplete correctly return two contacts from two ldap with same id
This commit is contained in:
@@ -239,6 +239,9 @@
|
||||
[newRecord setObject: [oldRecord objectForKey: @"c_uid"]
|
||||
forKey: @"c_uid"];
|
||||
|
||||
//source id
|
||||
[newRecord setObject: [source sourceID] forKey: @"sourceID"];
|
||||
|
||||
// c_name => id
|
||||
[newRecord setObject: [oldRecord objectForKey: @"c_name"]
|
||||
forKey: @"c_name"];
|
||||
|
||||
@@ -103,7 +103,12 @@
|
||||
return AddressBook.$$resource.fetch(null, 'allContactSearch', params).then(function(response) {
|
||||
var results, card, index,
|
||||
compareIds = function(data) {
|
||||
return this.id == data.id;
|
||||
if(this.sourceID === undefined || data.sourceid === undefined) {
|
||||
return this.id == data.id;
|
||||
}
|
||||
else {
|
||||
return this.id == data.id && this.sourceID == data.sourceid;
|
||||
}
|
||||
};
|
||||
if (excludedCards) {
|
||||
// Remove excluded cards from results
|
||||
@@ -130,7 +135,7 @@
|
||||
cards.splice(index, 0, card);
|
||||
}
|
||||
});
|
||||
AddressBook.$log.debug(cards);
|
||||
// AddressBook.$log.debug(cards);
|
||||
return cards;
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user