Add contact with only number and presence to filter, open contactListView on ContactsAll

This commit is contained in:
REIS Benjamin 2016-10-10 15:10:16 +02:00
parent 844a9839c3
commit c5caf03513
2 changed files with 8 additions and 4 deletions

View file

@ -118,7 +118,6 @@ static int ms_strcmpfuz(const char *fuzzy_word, const char *sentence) {
for (NSString *addr in LinphoneManager.instance.fastAddressBook.addressBookMap) {
Contact *contact = [LinphoneManager.instance.fastAddressBook.addressBookMap objectForKey:addr];
BOOL add = true;
// Do not add the contact directly if we set some filter
@ -128,6 +127,11 @@ static int ms_strcmpfuz(const char *fuzzy_word, const char *sentence) {
if ([FastAddressBook contactHasValidSipDomain:contact]) {
add = true;
}
if (contact.friend && linphone_presence_model_get_basic_status(linphone_friend_get_presence_model(contact.friend)) == LinphonePresenceBasicStatusOpen){
add = true;
}
if (!add && [ContactSelection emailFilterEnabled]) {
// Add this contact if it has an email
add = (contact.emails.count > 0);

View file

@ -106,10 +106,10 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)viewDidLoad {
[super viewDidLoad];
tableController.tableView.accessibilityIdentifier = @"Contacts table";
[self changeView:ContactsLinphone];
if ([tableController totalNumberOfItems] == 0) {
[self changeView:ContactsAll];
/*if ([tableController totalNumberOfItems] == 0) {
[self changeView:ContactsAll];
}
}*/
}
- (void)viewWillAppear:(BOOL)animated {