diff --git a/Classes/ChatConversationCreateTableView.m b/Classes/ChatConversationCreateTableView.m index 4f9ddc42b..2dd421c89 100644 --- a/Classes/ChatConversationCreateTableView.m +++ b/Classes/ChatConversationCreateTableView.m @@ -167,7 +167,7 @@ if (!addr) return cell; - cell.linphoneImage.hidden = !linphoneContact; + cell.linphoneImage.hidden = [LinphoneManager.instance lpConfigBoolForKey:@"hide_linphone_contacts" inSection:@"app"] || !linphoneContact; cell.securityImage.hidden = !(model && linphone_presence_model_has_capability(model, LinphoneFriendCapabilityLimeX3dh)); int capabilities = [[_addressesCached objectAtIndex:indexPath.row] intValue]; BOOL greyCellForEncryptedChat = _isEncrypted ? capabilities > 1 : TRUE; diff --git a/Classes/ChatConversationCreateView.m b/Classes/ChatConversationCreateView.m index 2c498b1e0..61e90ab83 100644 --- a/Classes/ChatConversationCreateView.m +++ b/Classes/ChatConversationCreateView.m @@ -74,6 +74,13 @@ static UICompositeViewDescription *compositeDescription = nil; object:nil]; LinphoneProxyConfig *cfg = linphone_core_get_default_proxy_config(LC); _chiffreOptionView.hidden = !(cfg && linphone_proxy_config_get_conference_factory_uri(cfg)); + if ([LinphoneManager.instance lpConfigBoolForKey:@"hide_linphone_contacts" inSection:@"app"]) { + self.linphoneButton.hidden = TRUE; + self.selectedButtonImage.hidden = TRUE; + CGRect frame = _allButton.frame; + frame.origin.x = _linphoneButton.frame.origin.x; + _allButton.frame = frame; + } } - (void)viewUpdateEvent:(NSNotification *)notif { @@ -198,6 +205,9 @@ typedef enum { ContactsAll, ContactsLinphone, ContactsMAX } ContactsCategory; [_tableController loadData]; } _selectedButtonImage.frame = frame; + if ([LinphoneManager.instance lpConfigBoolForKey:@"hide_linphone_contacts" inSection:@"app"]) { + _allButton.selected = FALSE; + } } - (IBAction)onAllClick:(id)event { diff --git a/Classes/ContactsListView.m b/Classes/ContactsListView.m index 165a4fb0f..b6921e35a 100644 --- a/Classes/ContactsListView.m +++ b/Classes/ContactsListView.m @@ -139,6 +139,10 @@ static UICompositeViewDescription *compositeDescription = nil; } [self refreshButtons]; [_toggleSelectionButton setImage:[UIImage imageNamed:@"select_all_default.png"] forState:UIControlStateSelected]; + if ([LinphoneManager.instance lpConfigBoolForKey:@"hide_linphone_contacts" inSection:@"app"]) { + self.linphoneButton.hidden = TRUE; + self.selectedButtonImage.hidden = TRUE; + } } - (void)viewDidAppear:(BOOL)animated { @@ -206,6 +210,9 @@ static UICompositeViewDescription *compositeDescription = nil; [tableController loadData]; } _selectedButtonImage.frame = frame; + if ([LinphoneManager.instance lpConfigBoolForKey:@"hide_linphone_contacts" inSection:@"app"]) { + allButton.selected = FALSE; + } } - (void)refreshButtons { diff --git a/Classes/HistoryDetailsView.m b/Classes/HistoryDetailsView.m index 872f87be3..d3b75725b 100644 --- a/Classes/HistoryDetailsView.m +++ b/Classes/HistoryDetailsView.m @@ -146,7 +146,7 @@ static UICompositeViewDescription *compositeDescription = nil; [_avatarImage setImage:[FastAddressBook imageForAddress:addr] bordered:NO withRoundedRadius:YES]; Contact *contact = [FastAddressBook getContactWithAddress:addr]; const LinphonePresenceModel *model = contact.friend ? linphone_friend_get_presence_model(contact.friend) : NULL; - _linphoneImage.hidden = + _linphoneImage.hidden = [LinphoneManager.instance lpConfigBoolForKey:@"hide_linphone_contacts" inSection:@"app"] || ! ((model && linphone_presence_model_get_basic_status(model) == LinphonePresenceBasicStatusOpen) || [FastAddressBook contactHasValidSipDomain:contact]); LinphoneProxyConfig *cfg = linphone_core_get_default_proxy_config(LC); [self shouldHideEncryptedChatView:cfg && linphone_proxy_config_get_conference_factory_uri(cfg) && model && linphone_presence_model_has_capability(model, LinphoneFriendCapabilityLimeX3dh)]; diff --git a/Classes/LinphoneUI/UIContactCell.m b/Classes/LinphoneUI/UIContactCell.m index d4873e634..47b58ac55 100644 --- a/Classes/LinphoneUI/UIContactCell.m +++ b/Classes/LinphoneUI/UIContactCell.m @@ -79,7 +79,7 @@ _linphoneImage.hidden = TRUE; if(_contact) { [ContactDisplay setDisplayNameLabel:_nameLabel forContact:_contact]; - _linphoneImage.hidden = + _linphoneImage.hidden = [LinphoneManager.instance lpConfigBoolForKey:@"hide_linphone_contacts" inSection:@"app"] || ! ((_contact.friend && linphone_presence_model_get_basic_status(linphone_friend_get_presence_model(_contact.friend)) == LinphonePresenceBasicStatusOpen) || [FastAddressBook contactHasValidSipDomain:_contact]); } } diff --git a/Classes/LinphoneUI/UIContactDetailsCell.m b/Classes/LinphoneUI/UIContactDetailsCell.m index 4610e1eaa..f303d6f53 100644 --- a/Classes/LinphoneUI/UIContactDetailsCell.m +++ b/Classes/LinphoneUI/UIContactDetailsCell.m @@ -64,7 +64,7 @@ if (contact) { const LinphonePresenceModel *model = contact.friend ? linphone_friend_get_presence_model_for_uri_or_tel(contact.friend, _addressLabel.text.UTF8String) : NULL; - self.linphoneImage.hidden = + self.linphoneImage.hidden = [LinphoneManager.instance lpConfigBoolForKey:@"hide_linphone_contacts" inSection:@"app"] || !((model && linphone_presence_model_get_basic_status(model) == LinphonePresenceBasicStatusOpen) || (cfg && !linphone_proxy_config_is_phone_number(cfg, _addressLabel.text.UTF8String) && @@ -109,7 +109,7 @@ Contact *contact = [FastAddressBook getContactWithAddress:(addr)]; if (contact) { - self.linphoneImage.hidden = ! ((contact.friend && linphone_presence_model_get_basic_status(linphone_friend_get_presence_model_for_uri_or_tel(contact.friend, _addressLabel.text.UTF8String)) == LinphonePresenceBasicStatusOpen) || (cfg && !linphone_proxy_config_is_phone_number(cfg, _addressLabel.text.UTF8String) && [FastAddressBook isSipURIValid:_addressLabel.text])); + self.linphoneImage.hidden =[LinphoneManager.instance lpConfigBoolForKey:@"hide_linphone_contacts" inSection:@"app"] || ! ((contact.friend && linphone_presence_model_get_basic_status(linphone_friend_get_presence_model_for_uri_or_tel(contact.friend, _addressLabel.text.UTF8String)) == LinphonePresenceBasicStatusOpen) || (cfg && !linphone_proxy_config_is_phone_number(cfg, _addressLabel.text.UTF8String) && [FastAddressBook isSipURIValid:_addressLabel.text])); } if (addr) {