mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
fix update view of contact deleted
This commit is contained in:
parent
c283f4d549
commit
ad47d9b24e
3 changed files with 15 additions and 7 deletions
|
|
@ -73,9 +73,17 @@
|
|||
|
||||
- (void)removeContact {
|
||||
inhibUpdate = TRUE;
|
||||
[[LinphoneManager.instance fastAddressBook] deleteContact:_contact];
|
||||
inhibUpdate = FALSE;
|
||||
[PhoneMainView.instance popCurrentView];
|
||||
[[LinphoneManager.instance fastAddressBook] deleteContact:_contact];
|
||||
inhibUpdate = FALSE;
|
||||
|
||||
if (IPAD) {
|
||||
ContactsListView *view = VIEW(ContactsListView);
|
||||
if (![view .tableController selectFirstRow]) {
|
||||
[self setContact:nil];
|
||||
}
|
||||
}
|
||||
|
||||
[PhoneMainView.instance popCurrentView];
|
||||
}
|
||||
|
||||
- (void)saveData {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ NSArray *sortedAddresses;
|
|||
}
|
||||
|
||||
- (void)onAddressBookUpdate:(NSNotification *)k {
|
||||
if (!_ongoing && (PhoneMainView.instance.currentView == ContactsListView.compositeViewDescription)) {
|
||||
if (!_ongoing && ((PhoneMainView.instance.currentView == ContactsListView.compositeViewDescription) || (IPAD && PhoneMainView.instance.currentView == ContactDetailsView.compositeViewDescription))) {
|
||||
[self loadData];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -357,8 +357,6 @@
|
|||
if(mCNContact != nil){
|
||||
[saveRequest deleteContact:mCNContact];
|
||||
@try {
|
||||
BOOL success = [store executeSaveRequest:saveRequest error:nil];
|
||||
NSLog(@"Success %d", success);
|
||||
[self removeFriend:contact ];
|
||||
[LinphoneManager.instance setContactsUpdated:TRUE];
|
||||
if([contact.sipAddresses count] > 0){
|
||||
|
|
@ -371,6 +369,8 @@
|
|||
[_addressBookMap removeObjectForKey:([FastAddressBook normalizeSipURI:phone] ?: phone)];
|
||||
}
|
||||
}
|
||||
BOOL success = [store executeSaveRequest:saveRequest error:nil];
|
||||
NSLog(@"Success %d", success);
|
||||
} @catch (NSException *exception) {
|
||||
NSLog(@"description = %@", [exception description]);
|
||||
return FALSE;
|
||||
|
|
@ -439,9 +439,9 @@
|
|||
}
|
||||
NSError *saveError;
|
||||
@try {
|
||||
NSLog(@"Success %d", [store executeSaveRequest:saveRequest error:&saveError]);
|
||||
[self updateFriend:contact];
|
||||
[LinphoneManager.instance setContactsUpdated:TRUE];
|
||||
NSLog(@"Success %d", [store executeSaveRequest:saveRequest error:&saveError]);
|
||||
} @catch (NSException *exception) {
|
||||
NSLog(@"=====>>>>> CNContact SaveRequest failed : description = %@", [exception description]);
|
||||
return FALSE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue