From ebc8f136f46eeb893308f939d8b01a27d0419787 Mon Sep 17 00:00:00 2001 From: Danmei Chen Date: Wed, 26 Feb 2020 10:41:47 +0100 Subject: [PATCH] fix my devices list --- Classes/DevicesListView.m | 2 +- Classes/LinphoneUI/UIDevicesDetails.h | 2 +- Classes/LinphoneUI/UIDevicesDetails.m | 18 ++---------------- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/Classes/DevicesListView.m b/Classes/DevicesListView.m index 122bdc925..971b46a47 100644 --- a/Classes/DevicesListView.m +++ b/Classes/DevicesListView.m @@ -132,7 +132,7 @@ static UICompositeViewDescription *compositeDescription = nil; entry->myself ? cell.addressLabel.text = NSLocalizedString(@"Me", nil) : [ContactDisplay setDisplayNameLabel:cell.addressLabel forAddress:linphone_participant_get_address(entry->participant)]; cell.participant = entry->participant; - [cell update:(entry->numberOfDevices != 0) isMyself:entry->myself]; + [cell update:(entry->numberOfDevices != 0)]; return cell; } diff --git a/Classes/LinphoneUI/UIDevicesDetails.h b/Classes/LinphoneUI/UIDevicesDetails.h index d3d9ea960..ef2f34c42 100644 --- a/Classes/LinphoneUI/UIDevicesDetails.h +++ b/Classes/LinphoneUI/UIDevicesDetails.h @@ -31,5 +31,5 @@ - (IBAction)onSecurityCallClick:(id)sender; - (id)initWithIdentifier:(NSString *)identifier; -- (void)update:(BOOL)listOpen isMyself:(BOOL)isMyself; +- (void)update:(BOOL)listOpen; @end diff --git a/Classes/LinphoneUI/UIDevicesDetails.m b/Classes/LinphoneUI/UIDevicesDetails.m index 2bd569194..8f528900d 100644 --- a/Classes/LinphoneUI/UIDevicesDetails.m +++ b/Classes/LinphoneUI/UIDevicesDetails.m @@ -38,23 +38,9 @@ return self; } -- (void)update:(BOOL)listOpen isMyself:(BOOL)isMyself { +- (void)update:(BOOL)listOpen { _devices = linphone_participant_get_devices(_participant); - if (isMyself) { - // remove my device - // TODO replaced by bctbx_list_remove_custom when server can remove device which has no app - bctbx_list_t *cur; - bctbx_list_t *elem = _devices; - while (elem != NULL) { - cur = elem; - elem = elem->next; - if ([[NSString stringWithUTF8String:linphone_participant_device_get_name(cur->data) ? : - linphone_address_as_string_uri_only(linphone_participant_device_get_address(cur->data))] isEqualToString:[[UIDevice currentDevice] name]]) { - _devices = bctbx_list_remove(_devices, cur->data); - break; - } - } - } + UIImage *image = [FastAddressBook imageForSecurityLevel:linphone_participant_get_security_level(_participant)]; if (bctbx_list_size(_devices) == 1) { [_securityButton setImage:image forState:UIControlStateNormal];