forked from mirrors/linphone-iphone
prevent freeze of search bar [Switch submodule branch]
This commit is contained in:
parent
4c3a7be941
commit
e8376174e7
4 changed files with 21 additions and 20 deletions
|
|
@ -72,26 +72,27 @@
|
|||
bctbx_list_t *results = linphone_magic_search_get_contact_list_from_filter(_magicSearch, filter.UTF8String, "");
|
||||
while (results) {
|
||||
LinphoneSearchResult *result = results->data;
|
||||
const LinphoneAddress* addr = linphone_search_result_get_address(result) ?: linphone_friend_get_address(linphone_search_result_get_friend(result));
|
||||
if (!addr)
|
||||
continue;
|
||||
|
||||
char *uri = linphone_address_as_string_uri_only(addr);
|
||||
NSString *address = [NSString stringWithUTF8String:uri];
|
||||
ms_free(uri);
|
||||
const LinphoneFriend *friend = linphone_search_result_get_friend(result);
|
||||
const LinphoneAddress* addr = linphone_search_result_get_address(result);
|
||||
if (friend) {
|
||||
|
||||
Contact *contact = [LinphoneManager.instance.fastAddressBook.addressBookMap objectForKey:address];
|
||||
NSString *name = [FastAddressBook displayNameForContact:contact];
|
||||
Boolean linphoneContact = [FastAddressBook contactHasValidSipDomain:contact]
|
||||
|| (contact.friend && linphone_presence_model_get_basic_status(linphone_friend_get_presence_model(contact.friend)) == LinphonePresenceBasicStatusOpen);
|
||||
BOOL add = _allFilter || linphoneContact;
|
||||
} else if (addr) {
|
||||
char *uri = linphone_address_as_string_uri_only(addr);
|
||||
NSString *address = [NSString stringWithUTF8String:uri];
|
||||
ms_free(uri);
|
||||
|
||||
if (((filter.length == 0)
|
||||
|| ([name.lowercaseString containsSubstring:filter.lowercaseString])
|
||||
|| ([address.lowercaseString containsSubstring:filter.lowercaseString]))
|
||||
&& add)
|
||||
[_addresses addObject:address];
|
||||
Contact *contact = [LinphoneManager.instance.fastAddressBook.addressBookMap objectForKey:address];
|
||||
NSString *name = [FastAddressBook displayNameForContact:contact];
|
||||
Boolean linphoneContact = [FastAddressBook contactHasValidSipDomain:contact]
|
||||
|| (contact.friend && linphone_presence_model_get_basic_status(linphone_friend_get_presence_model(contact.friend)) == LinphonePresenceBasicStatusOpen);
|
||||
BOOL add = _allFilter || linphoneContact;
|
||||
|
||||
if (((filter.length == 0)
|
||||
|| ([name.lowercaseString containsSubstring:filter.lowercaseString])
|
||||
|| ([address.lowercaseString containsSubstring:filter.lowercaseString]))
|
||||
&& add)
|
||||
[_addresses addObject:address];
|
||||
}
|
||||
results = results->next;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 7df8b5ca085010ec35103414ed9582412aaff97d
|
||||
Subproject commit dd0b0925e1aea3ae2a17481077319ed7ab2f203e
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 18abde9e43e8f98e22c09afee3e089c4e7691173
|
||||
Subproject commit 8e841b047641b1812a83880a90e89d702747ca5b
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 716ceeb474a415d685ca0f8377c3bf20819f9866
|
||||
Subproject commit 51d5589edf03ae07ca45f734c7a329cc1355c1ad
|
||||
Loading…
Add table
Reference in a new issue