diff --git a/CHANGES.rst b/CHANGES.rst index 65f5aa0ba..4109d36bb 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,6 +10,8 @@ Changes to be released in next version * VoIP: Text & icon changes on call tiles (#4642). * Voice messages: Stop recording and go into locked mode when the application becomes inactive (#4656) * Voice messages: Allow voice message playback control from the iOS lock screen and control center (#4655) + * Voice messages: Improve audio recording quality + * Voice messages: Remove labs setting and enable them by default 🐛 Bugfix * diff --git a/Config/BuildSettings.swift b/Config/BuildSettings.swift index ed613fa9b..85f25282a 100644 --- a/Config/BuildSettings.swift +++ b/Config/BuildSettings.swift @@ -309,10 +309,6 @@ final class BuildSettings: NSObject { static let messageDetailsAllowCopyMedia: Bool = true static let messageDetailsAllowPasteMedia: Bool = true - // MARK: - Voice Message - - static let voiceMessagesEnabled = false - // MARK: - Notifications static let decryptNotificationsByDefault: Bool = true diff --git a/Riot/Managers/Settings/RiotSettings.swift b/Riot/Managers/Settings/RiotSettings.swift index 7d41bc4df..2b60b3123 100644 --- a/Riot/Managers/Settings/RiotSettings.swift +++ b/Riot/Managers/Settings/RiotSettings.swift @@ -52,7 +52,6 @@ final class RiotSettings: NSObject { static let roomCreationScreenRoomIsPublic = "roomCreationScreenRoomIsPublic" static let allowInviteExernalUsers = "allowInviteExernalUsers" static let enableRingingForGroupCalls = "enableRingingForGroupCalls" - static let enableVoiceMessages = "enableVoiceMessages" static let roomSettingsScreenShowLowPriorityOption = "roomSettingsScreenShowLowPriorityOption" static let roomSettingsScreenShowDirectChatOption = "roomSettingsScreenShowDirectChatOption" static let roomSettingsScreenAllowChangingAccessSettings = "roomSettingsScreenAllowChangingAccessSettings" @@ -96,7 +95,6 @@ final class RiotSettings: NSObject { private override init() { super.init() - defaults.register(defaults: [UserDefaultsKeys.enableVoiceMessages: BuildSettings.voiceMessagesEnabled]) } // MARK: Servers @@ -221,14 +219,6 @@ final class RiotSettings: NSObject { } } - var enableVoiceMessages: Bool { - get { - return defaults.bool(forKey: UserDefaultsKeys.enableVoiceMessages) - } set { - defaults.set(newValue, forKey: UserDefaultsKeys.enableVoiceMessages) - } - } - // MARK: Calls /// Indicate if `allowStunServerFallback` settings has been set once. diff --git a/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.m b/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.m index 2234cbf9a..1ebe7f099 100644 --- a/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.m +++ b/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.m @@ -82,10 +82,6 @@ const CGFloat kComposerContainerTrailingPadding = 12; - (void)setVoiceMessageToolbarView:(UIView *)voiceMessageToolbarView { - if (RiotSettings.shared.enableVoiceMessages == NO) { - return; - } - _voiceMessageToolbarView = voiceMessageToolbarView; self.voiceMessageToolbarView.translatesAutoresizingMaskIntoConstraints = NO; [self addSubview:self.voiceMessageToolbarView]; @@ -407,10 +403,7 @@ const CGFloat kComposerContainerTrailingPadding = 12; [UIView animateWithDuration:kActionMenuContentAlphaAnimationDuration delay:_actionMenuOpened ? 0 : .1 options:UIViewAnimationOptionCurveEaseIn animations:^{ self->messageComposerContainer.alpha = actionMenuOpened ? 0 : 1; self.rightInputToolbarButton.alpha = self->growingTextView.text.length == 0 || actionMenuOpened ? 0 : 1; - if (RiotSettings.shared.enableVoiceMessages) - { - self.voiceMessageToolbarView.alpha = self->growingTextView.text.length > 0 || actionMenuOpened ? 0 : 1; - } + self.voiceMessageToolbarView.alpha = self->growingTextView.text.length > 0 || actionMenuOpened ? 0 : 1; } completion:nil]; [UIView animateWithDuration:kActionMenuComposerHeightAnimationDuration animations:^{ @@ -442,16 +435,7 @@ const CGFloat kComposerContainerTrailingPadding = 12; - (void)updateUIWithTextMessage:(NSString *)textMessage animated:(BOOL)animated { self.actionMenuOpened = NO; - - if (RiotSettings.shared.enableVoiceMessages == NO) { - self.rightInputToolbarButton.alpha = textMessage.length ? 1.0f : 0.0f; - self.messageComposerContainerTrailingConstraint.constant = (textMessage.length ? self.frame.size.width - self.rightInputToolbarButton.frame.origin.x : 0.0f) + kComposerContainerTrailingPadding; - - [self layoutIfNeeded]; - return; - } - [UIView animateWithDuration:(animated ? 0.15f : 0.0f) animations:^{ self.rightInputToolbarButton.alpha = textMessage.length ? 1.0f : 0.0f; self.voiceMessageToolbarView.alpha = textMessage.length ? 0.0f : 1.0; diff --git a/Riot/Modules/Room/VoiceMessages/VoiceMessageAudioConverter.swift b/Riot/Modules/Room/VoiceMessages/VoiceMessageAudioConverter.swift index c6ca771be..0c521b1b8 100644 --- a/Riot/Modules/Room/VoiceMessages/VoiceMessageAudioConverter.swift +++ b/Riot/Modules/Room/VoiceMessages/VoiceMessageAudioConverter.swift @@ -24,7 +24,7 @@ enum VoiceMessageAudioConverterError: Error { struct VoiceMessageAudioConverter { static func convertToOpusOgg(sourceURL: URL, destinationURL: URL, completion: @escaping (Result) -> Void) { - let command = "-hide_banner -y -i \"\(sourceURL.path)\" -c:a libopus -b:a -b:a 24k \"\(destinationURL.path)\"" + let command = "-hide_banner -y -i \"\(sourceURL.path)\" -c:a libopus -b:a 24k \"\(destinationURL.path)\"" executeCommand(command, completion: completion) } diff --git a/Riot/Modules/Settings/SettingsViewController.m b/Riot/Modules/Settings/SettingsViewController.m index 7f40c9ded..29765dd4a 100644 --- a/Riot/Modules/Settings/SettingsViewController.m +++ b/Riot/Modules/Settings/SettingsViewController.m @@ -144,7 +144,6 @@ enum enum { LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX = 0, - LABS_ENABLE_VOICE_MESSAGES = 1 }; enum @@ -495,7 +494,6 @@ TableViewSectionsDelegate> { Section *sectionLabs = [Section sectionWithTag:SECTION_TAG_LABS]; [sectionLabs addRowWithTag:LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX]; - [sectionLabs addRowWithTag:LABS_ENABLE_VOICE_MESSAGES]; sectionLabs.headerTitle = NSLocalizedStringFromTable(@"settings_labs", @"Vector", nil); if (sectionLabs.hasAnyRows) { @@ -2315,17 +2313,6 @@ TableViewSectionsDelegate> [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableRingingForGroupCalls:) forControlEvents:UIControlEventValueChanged]; - cell = labelAndSwitchCell; - } else if (row == LABS_ENABLE_VOICE_MESSAGES) - { - MXKTableViewCellWithLabelAndSwitch *labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath]; - - labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_labs_voice_messages", @"Vector", nil); - labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.enableVoiceMessages; - labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; - - [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableVoiceMessages:) forControlEvents:UIControlEventValueChanged]; - cell = labelAndSwitchCell; } } @@ -3034,11 +3021,6 @@ TableViewSectionsDelegate> RiotSettings.shared.enableRingingForGroupCalls = sender.isOn; } -- (void)toggleEnableVoiceMessages:(UISwitch *)sender -{ - RiotSettings.shared.enableVoiceMessages = sender.isOn; -} - - (void)togglePinRoomsWithMissedNotif:(UISwitch *)sender { RiotSettings.shared.pinRoomsWithMissedNotificationsOnHome = sender.isOn;