mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-04-18 23:18:27 +00:00
show all my devices
This commit is contained in:
parent
7ed3c5bbf7
commit
ce8d0ea359
2 changed files with 5 additions and 8 deletions
|
|
@ -86,9 +86,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
LinphoneParticipant *me = linphone_chat_room_get_me(_room);
|
LinphoneParticipant *me = linphone_chat_room_get_me(_room);
|
||||||
// not show me if there is only one device
|
[_devicesMenuEntries addObject:[[DevicesMenuEntry alloc] initWithTitle:me number:0 isMe:TRUE]];
|
||||||
if (bctbx_list_size(linphone_participant_get_devices(me)) > 1)
|
|
||||||
[_devicesMenuEntries addObject:[[DevicesMenuEntry alloc] initWithTitle:me number:0 isMe:TRUE]];
|
|
||||||
|
|
||||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||||
[_tableView reloadData];
|
[_tableView reloadData];
|
||||||
|
|
@ -114,8 +112,6 @@ static UICompositeViewDescription *compositeDescription = nil;
|
||||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(nonnull NSIndexPath *)indexPath
|
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(nonnull NSIndexPath *)indexPath
|
||||||
{
|
{
|
||||||
DevicesMenuEntry *entry = [_devicesMenuEntries objectAtIndex:indexPath.row];
|
DevicesMenuEntry *entry = [_devicesMenuEntries objectAtIndex:indexPath.row];
|
||||||
if (entry->myself)
|
|
||||||
return (entry->numberOfDevices + 1) * 56.0;
|
|
||||||
return entry->numberOfDevices > 1 ? (entry->numberOfDevices + 1) * 56.0 : 56.0;
|
return entry->numberOfDevices > 1 ? (entry->numberOfDevices + 1) * 56.0 : 56.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -142,9 +138,6 @@ static UICompositeViewDescription *compositeDescription = nil;
|
||||||
NSInteger num = 0;
|
NSInteger num = 0;
|
||||||
if (entry->numberOfDevices == 0) {
|
if (entry->numberOfDevices == 0) {
|
||||||
num = bctbx_list_size(linphone_participant_get_devices(entry->participant));
|
num = bctbx_list_size(linphone_participant_get_devices(entry->participant));
|
||||||
// not show current device
|
|
||||||
if (entry->myself)
|
|
||||||
num -= 1;
|
|
||||||
}
|
}
|
||||||
[_devicesMenuEntries replaceObjectAtIndex:indexPath.row withObject:[[DevicesMenuEntry alloc] initWithTitle:entry->participant number:num isMe:entry->myself]];
|
[_devicesMenuEntries replaceObjectAtIndex:indexPath.row withObject:[[DevicesMenuEntry alloc] initWithTitle:entry->participant number:num isMe:entry->myself]];
|
||||||
[_tableView reloadData];
|
[_tableView reloadData];
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)update {
|
- (void)update {
|
||||||
|
if (!_device) {
|
||||||
|
LOGE(@"Can not update, because the device is null.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
[_securityButton setImage:[FastAddressBook imageForSecurityLevel:linphone_participant_device_get_security_level(_device)] forState:UIControlStateNormal];
|
[_securityButton setImage:[FastAddressBook imageForSecurityLevel:linphone_participant_device_get_security_level(_device)] forState:UIControlStateNormal];
|
||||||
|
|
||||||
_deviceLabel.text = [NSString stringWithUTF8String:linphone_participant_device_get_name(_device) ? :
|
_deviceLabel.text = [NSString stringWithUTF8String:linphone_participant_device_get_name(_device) ? :
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue