diff --git a/Classes/ChatConversationView.m b/Classes/ChatConversationView.m index 050d43c88..81b1ee6fa 100644 --- a/Classes/ChatConversationView.m +++ b/Classes/ChatConversationView.m @@ -1636,10 +1636,9 @@ void on_chat_room_conference_alert(LinphoneChatRoom *cr, const LinphoneEventLog -(BOOL) canAdminEphemeral:(LinphoneChatRoom *)cr { - return linphone_chat_room_has_capability(cr, LinphoneChatRoomCapabilitiesEphemeral) && ( - (linphone_chat_room_params_get_ephemeral_mode(linphone_chat_room_get_current_params(cr)) == LinphoneChatRoomEphemeralModeDeviceManaged) || - (linphone_chat_room_params_get_ephemeral_mode(linphone_chat_room_get_current_params(cr)) == LinphoneChatRoomEphemeralModeAdminManaged && linphone_participant_is_admin(linphone_chat_room_get_me(cr))) - ); + // If ephemeral mode is DeviceManaged, then we don't need to check anything else + return (linphone_chat_room_params_get_ephemeral_mode(linphone_chat_room_get_current_params(cr)) == LinphoneChatRoomEphemeralModeDeviceManaged) + || ( linphone_chat_room_has_capability(cr, LinphoneChatRoomCapabilitiesEphemeral) && linphone_chat_room_params_get_ephemeral_mode(linphone_chat_room_get_current_params(cr)) == LinphoneChatRoomEphemeralModeAdminManaged && linphone_participant_is_admin(linphone_chat_room_get_me(cr))); } @@ -1666,7 +1665,7 @@ void on_chat_room_conference_alert(LinphoneChatRoom *cr, const LinphoneEventLog [_tableController onEditClick:nil]; [self onEditionChangeClick:nil]; } - if ([ConfigManager.instance lpConfigBoolForKeyWithKey:@"ephemeral_feature" defaultValue:false] && [self canAdminEphemeral:_chatRoom]) { + if ([self canAdminEphemeral:_chatRoom]) { if (indexPath.row == 2) { EphemeralSettingsView *view = VIEW(EphemeralSettingsView); view.room = _chatRoom; @@ -1680,7 +1679,7 @@ void on_chat_room_conference_alert(LinphoneChatRoom *cr, const LinphoneEventLog } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return [ConfigManager.instance lpConfigBoolForKeyWithKey:@"ephemeral_feature" defaultValue:false] && [self canAdminEphemeral:_chatRoom] ? 3 : 2; + return [self canAdminEphemeral:_chatRoom] ? 3 : 2; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { @@ -1694,7 +1693,8 @@ void on_chat_room_conference_alert(LinphoneChatRoom *cr, const LinphoneEventLog cell.imageView.image = [LinphoneUtils resizeImage:[UIImage imageNamed:@"delete_default.png"] newSize:CGSizeMake(20, 25)]; cell.textLabel.text = NSLocalizedString(@"Delete messages",nil); } - if ([ConfigManager.instance lpConfigBoolForKeyWithKey:@"ephemeral_feature" defaultValue:false] && [self canAdminEphemeral:_chatRoom]) { + + if ([self canAdminEphemeral:_chatRoom]) { if (indexPath.row == 2) { cell.imageView.image = [LinphoneUtils resizeImage:[UIImage imageNamed:@"ephemeral_messages_default.png"] newSize:CGSizeMake(20, 25)]; cell.textLabel.text = NSLocalizedString(@"Ephemeral messages",nil); diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index 9e8108e44..5e9c11448 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -346,7 +346,6 @@ [self setInteger:maxSize forKey:@"auto_download_incoming_files_max_size"]; [self setBool:[VFSUtil vfsEnabledWithGroupName:kLinphoneMsgNotificationAppGroupId] forKey:@"vfs_enabled_mode"]; [self setBool:[lm lpConfigBoolForKey:@"auto_write_to_gallery_preference" withDefault:YES] forKey:@"auto_write_to_gallery_mode"]; - [self setBool:[lm lpConfigBoolForKey:@"ephemeral_feature" withDefault:NO] forKey:@"ephemeral_feature"]; } // network section @@ -812,7 +811,6 @@ } } [lm lpConfigSetBool:[self boolForKey:@"auto_write_to_gallery_mode"] forKey:@"auto_write_to_gallery_preference"]; - [lm lpConfigSetBool:[self boolForKey:@"ephemeral_feature"] forKey:@"ephemeral_feature"]; // network section BOOL edgeOpt = [self boolForKey:@"edge_opt_preference"]; diff --git a/Settings/InAppSettings.bundle/Chat.plist b/Settings/InAppSettings.bundle/Chat.plist index a8727c126..d5e3c9395 100644 --- a/Settings/InAppSettings.bundle/Chat.plist +++ b/Settings/InAppSettings.bundle/Chat.plist @@ -60,16 +60,6 @@ IASKTextAlignment IASKUITextAlignmentRight - - DefaultValue - - Key - ephemeral_feature - Title - Enable ephemeral messages (beta) - Type - PSToggleSwitchSpecifier - Type PSGroupSpecifier