VoIP: Remove "Placing VoIP/Video calls" from Settings > LABS. The feature is always enabled

This commit is contained in:
manuroe 2016-09-05 15:56:07 +02:00
parent 6a15fd1f3c
commit 5cd1535888
3 changed files with 6 additions and 43 deletions

View file

@ -252,7 +252,6 @@
"settings_fail_to_update_password" = "Fail to update password";
"settings_password_updated" = "Your password has been updated";
"settings_labs_outgoing_voip" = "Placing VoIP/Video calls";
"settings_labs_conference_call" = "Conference Call";
"settings_labs_conference_call_warning" = "Conference calling in Vector is in development and may not be reliable";

View file

@ -912,8 +912,7 @@
// Check whether the call option is supported
roomInputToolbarView.supportCallOption =
[[NSUserDefaults standardUserDefaults] boolForKey:@"labsEnableOutgoingVoIP"]
&& self.roomDataSource.mxSession.callManager != nil
self.roomDataSource.mxSession.callManager != nil
&& (self.roomDataSource.room.state.joinedMembers.count == 2
|| ([[NSUserDefaults standardUserDefaults] boolForKey:@"labsEnableConferenceCall"] && self.roomDataSource.room.state.joinedMembers.count > 2));

View file

@ -55,9 +55,8 @@
#define OTHER_CLEAR_CACHE_INDEX 6
#define OTHER_COUNT 7
#define LABS_VOIP_INDEX 0
#define LABS_CONFERENCE_CALL_INDEX 1
#define LABS_COUNT 2
#define LABS_CONFERENCE_CALL_INDEX 0
#define LABS_COUNT 1
#define SECTION_TITLE_PADDING_WHEN_HIDDEN 0.01f
@ -1008,35 +1007,15 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)();
}
else if (section == SETTINGS_SECTION_LABS_INDEX)
{
if (row == LABS_VOIP_INDEX)
{
MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_labs_outgoing_voip", @"Vector", nil);
labelAndSwitchCell.mxkSwitch.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"labsEnableOutgoingVoIP"];
[labelAndSwitchCell.mxkSwitch removeTarget:self action:nil forControlEvents:UIControlEventTouchUpInside];
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleLabsVoIP:) forControlEvents:UIControlEventTouchUpInside];
cell = labelAndSwitchCell;
}
else if (row == LABS_CONFERENCE_CALL_INDEX)
if (row == LABS_CONFERENCE_CALL_INDEX)
{
MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_labs_conference_call", @"Vector", nil);
labelAndSwitchCell.mxkSwitch.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"labsEnableConferenceCall"];
// VoIP must be enabled on order to change this settings
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"labsEnableOutgoingVoIP"])
{
[labelAndSwitchCell.mxkSwitch removeTarget:self action:nil forControlEvents:UIControlEventTouchUpInside];
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleLabsConferenceCall:) forControlEvents:UIControlEventTouchUpInside];
}
else
{
labelAndSwitchCell.mxkLabel.enabled = NO;
labelAndSwitchCell.mxkSwitch.enabled = NO;
}
cell = labelAndSwitchCell;
}
@ -1336,20 +1315,6 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)();
}
}
- (void)toggleLabsVoIP:(id)sender
{
BOOL enable = [[NSUserDefaults standardUserDefaults] boolForKey:@"labsEnableOutgoingVoIP"];
NSLog(@"[SettingsViewController] %@ VoIP", enable ? @"Disable" : @"Enable");
[[NSUserDefaults standardUserDefaults] setBool:!enable forKey:@"labsEnableOutgoingVoIP"];
[[NSUserDefaults standardUserDefaults] synchronize];
// Refresh the "Conference Call" button
[self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:LABS_CONFERENCE_CALL_INDEX inSection:SETTINGS_SECTION_LABS_INDEX]]
withRowAnimation:UITableViewRowAnimationNone];
}
- (void)toggleLabsConferenceCall:(id)sender
{
BOOL enable = [[NSUserDefaults standardUserDefaults] boolForKey:@"labsEnableConferenceCall"];