diff --git a/CHANGES.md b/CHANGES.md index 17f14bded..c8f9b1ae3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,15 @@ +## Changes in 1.8.1 (2022-02-16) + +🙌 Improvements + +- Upgrade MatrixSDK version ([v0.22.1](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.22.1)). + +🐛 Bugfixes + +- Settings: Fix a bug where tapping a toggle could change multiple settings. ([#5463](https://github.com/vector-im/element-ios/issues/5463)) +- Fix for images sometimes being sent unencrypted inside an encrypted room. ([#5564](https://github.com/vector-im/element-ios/issues/5564)) + + ## Changes in 1.8.0 (2022-02-09) ✨ Features diff --git a/Config/AppVersion.xcconfig b/Config/AppVersion.xcconfig index 64366834e..3fe634b3f 100644 --- a/Config/AppVersion.xcconfig +++ b/Config/AppVersion.xcconfig @@ -15,5 +15,5 @@ // // Version -MARKETING_VERSION = 1.8.0 -CURRENT_PROJECT_VERSION = 1.8.0 +MARKETING_VERSION = 1.8.1 +CURRENT_PROJECT_VERSION = 1.8.1 diff --git a/Podfile b/Podfile index c98ddb10c..523f61fc5 100644 --- a/Podfile +++ b/Podfile @@ -13,7 +13,7 @@ use_frameworks! # - `{ :specHash => {sdk spec hash}` to depend on specific pod options (:git => …, :podspec => …) for MatrixSDK repo. Used by Fastfile during CI # # Warning: our internal tooling depends on the name of this variable name, so be sure not to change it -$matrixSDKVersion = '= 0.22.0' +$matrixSDKVersion = '= 0.22.1' # $matrixSDKVersion = :local # $matrixSDKVersion = { :branch => 'develop'} # $matrixSDKVersion = { :specHash => { git: 'https://git.io/fork123', branch: 'fix' } } diff --git a/Podfile.lock b/Podfile.lock index 9f181b4bc..942bc098f 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -57,16 +57,16 @@ PODS: - LoggerAPI (1.9.200): - Logging (~> 1.1) - Logging (1.4.0) - - MatrixSDK (0.22.0): - - MatrixSDK/Core (= 0.22.0) - - MatrixSDK/Core (0.22.0): + - MatrixSDK (0.22.1): + - MatrixSDK/Core (= 0.22.1) + - MatrixSDK/Core (0.22.1): - AFNetworking (~> 4.0.0) - GZIP (~> 1.3.0) - libbase58 (~> 0.1.4) - OLMKit (~> 3.2.5) - Realm (= 10.16.0) - SwiftyBeaver (= 1.9.5) - - MatrixSDK/JingleCallStack (0.22.0): + - MatrixSDK/JingleCallStack (0.22.1): - JitsiMeetSDK (= 3.10.2) - MatrixSDK/Core - OLMKit (3.2.5): @@ -117,8 +117,8 @@ DEPENDENCIES: - KeychainAccess (~> 4.2.2) - KTCenterFlowLayout (~> 1.3.1) - libPhoneNumber-iOS (~> 0.9.13) - - MatrixSDK (= 0.22.0) - - MatrixSDK/JingleCallStack (= 0.22.0) + - MatrixSDK (= 0.22.1) + - MatrixSDK/JingleCallStack (= 0.22.1) - OLMKit - PostHog (~> 1.4.4) - ReadMoreTextView (~> 3.0.1) @@ -212,7 +212,7 @@ SPEC CHECKSUMS: libPhoneNumber-iOS: 0a32a9525cf8744fe02c5206eb30d571e38f7d75 LoggerAPI: ad9c4a6f1e32f518fdb43a1347ac14d765ab5e3d Logging: beeb016c9c80cf77042d62e83495816847ef108b - MatrixSDK: 21201cd007145d96beff24cc7f9727ced497c3fd + MatrixSDK: 12c1a56e037f629e493cbcd615fd13cfc58cee3a OLMKit: 9fb4799c4a044dd2c06bda31ec31a12191ad30b5 PostHog: 4b6321b521569092d4ef3a02238d9435dbaeb99f ReadMoreTextView: 19147adf93abce6d7271e14031a00303fe28720d @@ -229,6 +229,6 @@ SPEC CHECKSUMS: zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb -PODFILE CHECKSUM: 2a13c9d4f4894152af066c746582fde2e731cbff +PODFILE CHECKSUM: ae70a46e98aae87f130ad3d246711fc6b6ae7286 COCOAPODS: 1.11.2 diff --git a/Riot/Modules/Room/MXKRoomViewController.h b/Riot/Modules/Room/MXKRoomViewController.h index 45ad325b5..5eb96dd3e 100644 --- a/Riot/Modules/Room/MXKRoomViewController.h +++ b/Riot/Modules/Room/MXKRoomViewController.h @@ -438,10 +438,17 @@ typedef NS_ENUM(NSUInteger, MXKRoomViewControllerJoinRoomResult) { - (void)setBubbleTableViewContentOffset:(CGPoint)contentOffset animated:(BOOL)animated; /** - Handle typing notification. + Sends a typing notification with the specified timeout. @param typing Flag indicating whether the user is typing or not. + @param notificationTimeoutMS The length of time the typing notification is valid for */ -- (void)handleTypingNotification:(BOOL)typing; +- (void)sendTypingNotification:(BOOL)typing timeout:(NSUInteger)notificationTimeoutMS; + + +/** + Share encryption keys in this room. + */ +- (void)shareEncryptionKeys; @end diff --git a/Riot/Modules/Room/MXKRoomViewController.m b/Riot/Modules/Room/MXKRoomViewController.m index 0028f45f3..62199c34d 100644 --- a/Riot/Modules/Room/MXKRoomViewController.m +++ b/Riot/Modules/Room/MXKRoomViewController.m @@ -3299,7 +3299,7 @@ roomDataSource.partialTextMessage = inputToolbarView.textMessage; } - [self handleTypingNotification:typing]; + [self handleTypingState:typing]; } - (void)roomInputToolbarView:(MXKRoomInputToolbarView*)toolbarView heightDidChanged:(CGFloat)height completion:(void (^)(BOOL finished))completion @@ -3420,7 +3420,7 @@ } # pragma mark - Typing notification -- (void)handleTypingNotification:(BOOL)typing +- (void)handleTypingState:(BOOL)typing { NSUInteger notificationTimeoutMS = -1; if (typing) @@ -3482,6 +3482,11 @@ lastTypingDate = nil; } + [self sendTypingNotification:typing timeout:notificationTimeoutMS]; +} + +- (void)sendTypingNotification:(BOOL)typing timeout:(NSUInteger)notificationTimeoutMS +{ MXWeakify(self); // Send typing notification to server @@ -3512,7 +3517,7 @@ // Check whether a new typing event has been observed BOOL typing = (lastTypingDate != nil); // Post a new typing notification - [self handleTypingNotification:typing]; + [self handleTypingState:typing]; } diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index ce081145f..966a76e45 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -4564,6 +4564,15 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; [self.userSuggestionCoordinator processTextMessage:toolbarView.textMessage]; } +- (void)roomInputToolbarViewDidOpenActionMenu:(MXKRoomInputToolbarView*)toolbarView +{ + // Consider opening the action menu as beginning to type and share encryption keys if requested. + if ([MXKAppSettings standardAppSettings].outboundGroupSessionKeyPreSharingStrategy == MXKKeyPreSharingWhenTyping) + { + [self shareEncryptionKeys]; + } +} + #pragma mark - MXKRoomMemberDetailsViewControllerDelegate - (void)roomMemberDetailsViewController:(MXKRoomMemberDetailsViewController *)roomMemberDetailsViewController startChatWithMemberId:(NSString *)matrixId completion:(void (^)(void))completion diff --git a/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.h b/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.h index 282687128..e3feed12e 100644 --- a/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.h +++ b/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.h @@ -47,6 +47,13 @@ typedef enum : NSUInteger */ - (void)roomInputToolbarViewDidChangeTextMessage:(MXKRoomInputToolbarView*)toolbarView; +/** + Inform the delegate that the action menu was opened. + + @param toolbarView the room input toolbar view + */ +- (void)roomInputToolbarViewDidOpenActionMenu:(MXKRoomInputToolbarView*)toolbarView; + @end /** diff --git a/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.m b/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.m index cffe8fe1b..2ce98c82c 100644 --- a/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.m +++ b/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.m @@ -429,6 +429,7 @@ static const NSTimeInterval kActionMenuComposerHeightAnimationDuration = .3; if (_actionMenuOpened) { self.actionsBar.hidden = NO; [self.actionsBar animateWithShowIn:_actionMenuOpened completion:nil]; + [self.delegate roomInputToolbarViewDidOpenActionMenu:self]; } else { diff --git a/Riot/Modules/Settings/SettingsViewController.m b/Riot/Modules/Settings/SettingsViewController.m index d009b7b6e..d1e1f163d 100644 --- a/Riot/Modules/Settings/SettingsViewController.m +++ b/Riot/Modules/Settings/SettingsViewController.m @@ -158,7 +158,8 @@ typedef NS_ENUM(NSUInteger, ABOUT) typedef NS_ENUM(NSUInteger, LABS_ENABLE) { LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX = 0, - LABS_ENABLE_THREADS_INDEX + LABS_ENABLE_THREADS_INDEX, + LABS_ENABLE_MESSAGE_BUBBLES_INDEX }; typedef NS_ENUM(NSUInteger, SECURITY) @@ -508,7 +509,9 @@ TableViewSectionsDelegate> if (BuildSettings.roomScreenAllowTimelineStyleConfiguration) { - [sectionUserInterface addRowWithTag:USER_INTERFACE_TIMELINE_STYLE_INDEX]; + // NOTE: Message bubbles are under labs section atm + +// [sectionUserInterface addRowWithTag:USER_INTERFACE_TIMELINE_STYLE_INDEX]; } [tmpSections addObject: sectionUserInterface]; @@ -566,6 +569,7 @@ TableViewSectionsDelegate> Section *sectionLabs = [Section sectionWithTag:SECTION_TAG_LABS]; [sectionLabs addRowWithTag:LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX]; [sectionLabs addRowWithTag:LABS_ENABLE_THREADS_INDEX]; + [sectionLabs addRowWithTag:LABS_ENABLE_MESSAGE_BUBBLES_INDEX]; sectionLabs.headerTitle = [VectorL10n settingsLabs]; if (sectionLabs.hasAnyRows) { @@ -1469,6 +1473,21 @@ TableViewSectionsDelegate> return [footerText copy]; } +- (UITableViewCell *)buildMessageBubblesCellForTableView:(UITableView*)tableView + atIndexPath:(NSIndexPath*)indexPath +{ + MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath]; + + labelAndSwitchCell.mxkLabel.text = [VectorL10n settingsEnableRoomMessageBubbles]; + + labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.roomScreenEnableMessageBubbles; + labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; + labelAndSwitchCell.mxkSwitch.enabled = YES; + [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableRoomMessageBubbles:) forControlEvents:UIControlEventTouchUpInside]; + + return labelAndSwitchCell; +} + #pragma mark - 3Pid Add - (void)showAuthenticationIfNeededForAdding:(MX3PIDMedium)medium withSession:(MXSession*)session completion:(void (^)(NSDictionary* authParams))completion @@ -1976,7 +1995,7 @@ TableViewSectionsDelegate> labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; labelAndSwitchCell.mxkSwitch.enabled = YES; - [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableURLPreviews:) forControlEvents:UIControlEventValueChanged]; + [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableURLPreviews:) forControlEvents:UIControlEventTouchUpInside]; cell = labelAndSwitchCell; } @@ -2206,16 +2225,7 @@ TableViewSectionsDelegate> } else if (row == USER_INTERFACE_TIMELINE_STYLE_INDEX) { - MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath]; - - labelAndSwitchCell.mxkLabel.text = [VectorL10n settingsEnableRoomMessageBubbles]; - - labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.roomScreenEnableMessageBubbles; - labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; - labelAndSwitchCell.mxkSwitch.enabled = YES; - [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableRoomMessageBubbles:) forControlEvents:UIControlEventTouchUpInside]; - - cell = labelAndSwitchCell; + cell = [self buildMessageBubblesCellForTableView:tableView atIndexPath:indexPath]; } } else if (section == SECTION_TAG_IGNORED_USERS) @@ -2430,7 +2440,7 @@ TableViewSectionsDelegate> labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.enableRingingForGroupCalls; labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; - [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableRingingForGroupCalls:) forControlEvents:UIControlEventValueChanged]; + [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableRingingForGroupCalls:) forControlEvents:UIControlEventTouchUpInside]; cell = labelAndSwitchCell; } @@ -2442,10 +2452,14 @@ TableViewSectionsDelegate> labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.enableThreads; labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; - [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableThreads:) forControlEvents:UIControlEventValueChanged]; + [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableThreads:) forControlEvents:UIControlEventTouchUpInside]; cell = labelAndSwitchCell; } + else if (row == LABS_ENABLE_MESSAGE_BUBBLES_INDEX) + { + cell = [self buildMessageBubblesCellForTableView:tableView atIndexPath:indexPath]; + } } else if (section == SECTION_TAG_FLAIR) { diff --git a/Riot/Modules/Threads/Thread/ThreadViewController.swift b/Riot/Modules/Threads/Thread/ThreadViewController.swift index 2dace6547..765a9032a 100644 --- a/Riot/Modules/Threads/Thread/ThreadViewController.swift +++ b/Riot/Modules/Threads/Thread/ThreadViewController.swift @@ -70,8 +70,8 @@ class ThreadViewController: RoomViewController { super.onButtonPressed(sender) } - override func handleTypingNotification(_ typing: Bool) { - // no-op + override func sendTypingNotification(_ typing: Bool, timeout notificationTimeoutMS: UInt) { + // no-op } private func showThreadActions() {