VoIP: Remove "Conference Call" from Settings > LABS. The feature is always enabled

This commit is contained in:
manuroe
2016-09-05 16:05:27 +02:00
parent 2f86d178d0
commit 4eba375d40
3 changed files with 5 additions and 82 deletions
-3
View File
@@ -252,9 +252,6 @@
"settings_fail_to_update_password" = "Fail to update password";
"settings_password_updated" = "Your password has been updated";
"settings_labs_conference_call" = "Conference Call";
"settings_labs_conference_call_warning" = "Conference calling in Vector is in development and may not be reliable";
// Room Details
"room_details_title" = "Room Details";
"room_details_people" = "Members";
+3 -5
View File
@@ -912,9 +912,8 @@
// Check whether the call option is supported
roomInputToolbarView.supportCallOption =
self.roomDataSource.mxSession.callManager != nil
&& (self.roomDataSource.room.state.joinedMembers.count == 2
|| ([[NSUserDefaults standardUserDefaults] boolForKey:@"labsEnableConferenceCall"] && self.roomDataSource.room.state.joinedMembers.count > 2));
self.roomDataSource.mxSession.callManager
&& self.roomDataSource.room.state.joinedMembers.count >= 2;
// Set user picture in input toolbar
MXKImageView *userPictureView = roomInputToolbarView.pictureView;
@@ -2643,8 +2642,7 @@
{
[roomActivitiesView displayNetworkErrorNotification:NSLocalizedStringFromTable(@"room_offline_notification", @"Vector", nil)];
}
else if ([[NSUserDefaults standardUserDefaults] boolForKey:@"labsEnableConferenceCall"]
&& customizedRoomDataSource.room.state.isOngoingConferenceCall)
else if (customizedRoomDataSource.room.state.isOngoingConferenceCall)
{
// Show the "Ongoing conference call" banner only if the user is not in the conference
MXCall *callInRoom = [self.roomDataSource.mxSession.callManager callInRoom:self.roomDataSource.roomId];
+2 -74
View File
@@ -34,7 +34,7 @@
#define SETTINGS_SECTION_ADVANCED_INDEX 4
#define SETTINGS_SECTION_OTHER_INDEX 5
#define SETTINGS_SECTION_LABS_INDEX 6
#define SETTINGS_SECTION_COUNT 7
#define SETTINGS_SECTION_COUNT 6 // Not 7 because the LABS section is currently hidden
#define NOTIFICATION_SETTINGS_ENABLE_PUSH_INDEX 0
#define NOTIFICATION_SETTINGS_GLOBAL_SETTINGS_INDEX 1
@@ -55,8 +55,7 @@
#define OTHER_CLEAR_CACHE_INDEX 6
#define OTHER_COUNT 7
#define LABS_CONFERENCE_CALL_INDEX 0
#define LABS_COUNT 1
#define LABS_COUNT 0
#define SECTION_TITLE_PADDING_WHEN_HIDDEN 0.01f
@@ -1007,18 +1006,6 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)();
}
else if (section == SETTINGS_SECTION_LABS_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"];
[labelAndSwitchCell.mxkSwitch removeTarget:self action:nil forControlEvents:UIControlEventTouchUpInside];
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleLabsConferenceCall:) forControlEvents:UIControlEventTouchUpInside];
cell = labelAndSwitchCell;
}
}
return cell;
@@ -1315,65 +1302,6 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)();
}
}
- (void)toggleLabsConferenceCall:(id)sender
{
BOOL enable = [[NSUserDefaults standardUserDefaults] boolForKey:@"labsEnableConferenceCall"];
if (sender && !enable)
{
// Ask confirmation to the user before enabling it
UISwitch *switchButton;
if ([sender isKindOfClass:UISwitch.class])
{
switchButton = (UISwitch*)sender;
}
// Prevent the toggle from toggling without the user confirmation
[switchButton setOn:NO animated:YES];
[currentAlert dismiss:NO];
currentAlert = [[MXKAlert alloc] initWithTitle:NSLocalizedStringFromTable(@"warning", @"Vector", nil)
message:NSLocalizedStringFromTable(@"settings_labs_conference_call_warning", @"Vector", nil)
style:MXKAlertStyleAlert];
__weak typeof(self) weakSelf = self;
currentAlert.cancelButtonIndex = [currentAlert addActionWithTitle:[NSBundle mxk_localizedStringForKey:@"abort"] style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
if (weakSelf)
{
__strong __typeof(weakSelf)strongSelf = weakSelf;
strongSelf->currentAlert = nil;
}
}];
[currentAlert addActionWithTitle:[NSBundle mxk_localizedStringForKey:@"ok"] style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
if (weakSelf)
{
__strong __typeof(weakSelf)strongSelf = weakSelf;
strongSelf->currentAlert = nil;
// Apply the change
[switchButton setOn:YES animated:YES];
[strongSelf toggleLabsConferenceCall:nil];
}
}];
[currentAlert showInViewController:self];
}
else
{
NSLog(@"[SettingsViewController] %@ connference call", enable ? @"Disable" : @"Enable");
[[NSUserDefaults standardUserDefaults] setBool:!enable forKey:@"labsEnableConferenceCall"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
}
- (void)markAllAsRead:(id)sender
{
// Feedback: disable button and run activity indicator