diff --git a/CHANGES.md b/CHANGES.md index 78d2df426..698e5f4a3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,17 @@ +## Changes in 1.8.3 (2022-02-25) + +🙌 Improvements + +- Upgrade MatrixSDK version ([v0.22.4](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.22.4)). + +🐛 Bugfixes + +- Unified Search: Fix a bug where the room directory wasn't working. ([#5672](https://github.com/vector-im/element-ios/issues/5672)) +- Fixed crashes on implicitly unwrapped optionals in the PlainRoomTimelineCellDecorator. ([#5673](https://github.com/vector-im/element-ios/issues/5673)) +- L10n: Fix defaulting to English language ([#5674](https://github.com/vector-im/element-ios/issues/5674)) +- RoomDataSource: Do not reload room data source on back pagination for new threads. ([#5694](https://github.com/vector-im/element-ios/issues/5694)) + + ## Changes in 1.8.2 (2022-02-22) ✨ Features diff --git a/Config/AppVersion.xcconfig b/Config/AppVersion.xcconfig index de6ddc959..76b125c78 100644 --- a/Config/AppVersion.xcconfig +++ b/Config/AppVersion.xcconfig @@ -15,5 +15,5 @@ // // Version -MARKETING_VERSION = 1.8.2 -CURRENT_PROJECT_VERSION = 1.8.2 +MARKETING_VERSION = 1.8.3 +CURRENT_PROJECT_VERSION = 1.8.3 diff --git a/Podfile b/Podfile index 4fd6535ef..cbc8d341e 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.2' +$matrixSDKVersion = '= 0.22.4' # $matrixSDKVersion = :local # $matrixSDKVersion = { :branch => 'develop'} # $matrixSDKVersion = { :specHash => { git: 'https://git.io/fork123', branch: 'fix' } } diff --git a/Podfile.lock b/Podfile.lock index f6d6c86f9..17c0dedde 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -56,16 +56,16 @@ PODS: - LoggerAPI (1.9.200): - Logging (~> 1.1) - Logging (1.4.0) - - MatrixSDK (0.22.2): - - MatrixSDK/Core (= 0.22.2) - - MatrixSDK/Core (0.22.2): + - MatrixSDK (0.22.4): + - MatrixSDK/Core (= 0.22.4) + - MatrixSDK/Core (0.22.4): - 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.2): + - MatrixSDK/JingleCallStack (0.22.4): - JitsiMeetSDK (= 3.10.2) - MatrixSDK/Core - OLMKit (3.2.5): @@ -115,8 +115,8 @@ DEPENDENCIES: - KeychainAccess (~> 4.2.2) - KTCenterFlowLayout (~> 1.3.1) - libPhoneNumber-iOS (~> 0.9.13) - - MatrixSDK (= 0.22.2) - - MatrixSDK/JingleCallStack (= 0.22.2) + - MatrixSDK (= 0.22.4) + - MatrixSDK/JingleCallStack (= 0.22.4) - OLMKit - PostHog (~> 1.4.4) - ReadMoreTextView (~> 3.0.1) @@ -208,7 +208,7 @@ SPEC CHECKSUMS: libPhoneNumber-iOS: 0a32a9525cf8744fe02c5206eb30d571e38f7d75 LoggerAPI: ad9c4a6f1e32f518fdb43a1347ac14d765ab5e3d Logging: beeb016c9c80cf77042d62e83495816847ef108b - MatrixSDK: 4e7c8f0cfff3553e8dd60d97eef6b31653408ae7 + MatrixSDK: 0991e467a7da936fc5f7cdf0a277cd86a55cb4c0 OLMKit: 9fb4799c4a044dd2c06bda31ec31a12191ad30b5 PostHog: 4b6321b521569092d4ef3a02238d9435dbaeb99f ReadMoreTextView: 19147adf93abce6d7271e14031a00303fe28720d @@ -225,6 +225,6 @@ SPEC CHECKSUMS: zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb -PODFILE CHECKSUM: 093d29092285618a84be5d5abb772c15cb7dcba5 +PODFILE CHECKSUM: f8aca20e36984b48793a1bfb90f4fe8d5a134f7d COCOAPODS: 1.11.2 diff --git a/Riot/Modules/Application/LegacyAppDelegate.m b/Riot/Modules/Application/LegacyAppDelegate.m index 1c74e5ede..628a76508 100644 --- a/Riot/Modules/Application/LegacyAppDelegate.m +++ b/Riot/Modules/Application/LegacyAppDelegate.m @@ -369,6 +369,24 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni // Create message sound NSURL *messageSoundURL = [[NSBundle mainBundle] URLForResource:@"message" withExtension:@"caf"]; AudioServicesCreateSystemSoundID((__bridge CFURLRef)messageSoundURL, &_messageSound); + + // Set up runtime language and fallback by considering the userDefaults object shared within the application group. + NSUserDefaults *sharedUserDefaults = [MXKAppSettings standardAppSettings].sharedUserDefaults; + NSString *language = [sharedUserDefaults objectForKey:@"appLanguage"]; + if (!language) + { + // Check whether a langage was only defined at the Riot application level. + language = [[NSUserDefaults standardUserDefaults] objectForKey:@"appLanguage"]; + if (language) + { + // Move this setting into the shared userDefaults object to apply it to the extensions. + [sharedUserDefaults setObject:language forKey:@"appLanguage"]; + + [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"appLanguage"]; + } + } + [NSBundle mxk_setLanguage:language]; + [NSBundle mxk_setFallbackLanguage:@"en"]; // Set app info now as Mac (Designed for iPad) accesses it before didFinishLaunching is called self.appInfo = AppInfo.current; @@ -411,24 +429,6 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni // Set up theme ThemeService.shared.themeId = RiotSettings.shared.userInterfaceTheme; - // Set up runtime language and fallback by considering the userDefaults object shared within the application group. - NSUserDefaults *sharedUserDefaults = [MXKAppSettings standardAppSettings].sharedUserDefaults; - NSString *language = [sharedUserDefaults objectForKey:@"appLanguage"]; - if (!language) - { - // Check whether a langage was only defined at the Riot application level. - language = [[NSUserDefaults standardUserDefaults] objectForKey:@"appLanguage"]; - if (language) - { - // Move this setting into the shared userDefaults object to apply it to the extensions. - [sharedUserDefaults setObject:language forKey:@"appLanguage"]; - - [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"appLanguage"]; - } - } - [NSBundle mxk_setLanguage:language]; - [NSBundle mxk_setFallbackLanguage:@"en"]; - mxSessionArray = [NSMutableArray array]; callEventsListeners = [NSMutableDictionary dictionary]; diff --git a/Riot/Modules/GlobalSearch/DataSources/UnifiedSearchRecentsDataSource.m b/Riot/Modules/GlobalSearch/DataSources/UnifiedSearchRecentsDataSource.m index 94daf7c44..6bb0a8319 100644 --- a/Riot/Modules/GlobalSearch/DataSources/UnifiedSearchRecentsDataSource.m +++ b/Riot/Modules/GlobalSearch/DataSources/UnifiedSearchRecentsDataSource.m @@ -35,6 +35,18 @@ @implementation UnifiedSearchRecentsDataSource +- (instancetype)initWithMatrixSession:(MXSession *)mxSession recentsListService:(id)recentsListService +{ + self = [super initWithMatrixSession:mxSession recentsListService:recentsListService]; + if (self) + { + searchedRoomIdOrAliasSection = -1; + + _hideRecents = NO; + } + return self; +} + #pragma mark - - (void)setPublicRoomsDirectoryDataSource:(PublicRoomsDirectoryDataSource *)publicRoomsDirectoryDataSource diff --git a/Riot/Modules/Room/DataSources/RoomDataSource.m b/Riot/Modules/Room/DataSources/RoomDataSource.m index 2341e692a..f6b80f4e3 100644 --- a/Riot/Modules/Room/DataSources/RoomDataSource.m +++ b/Riot/Modules/Room/DataSources/RoomDataSource.m @@ -29,7 +29,7 @@ const CGFloat kTypingCellHeight = 24; -@interface RoomDataSource() +@interface RoomDataSource() { // Observe kThemeServiceDidChangeThemeNotification to handle user interface theme change. id kThemeServiceDidChangeThemeNotificationObserver; @@ -92,12 +92,9 @@ const CGFloat kTypingCellHeight = 24; [self reload]; }]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(newThreadCreated:) - name:MXThreadingService.newThreadCreated - object:nil]; - + + [matrixSession.threadingService addDelegate:self]; + [self registerKeyVerificationRequestNotification]; [self registerKeyVerificationTransactionNotification]; [self registerTrustLevelDidChangeNotifications]; @@ -177,6 +174,8 @@ const CGFloat kTypingCellHeight = 24; { [[NSNotificationCenter defaultCenter] removeObserver:self.keyVerificationTransactionDidChangeNotificationObserver]; } + + [self.mxSession.threadingService removeDelegate:self]; [super destroy]; } @@ -973,15 +972,20 @@ const CGFloat kTypingCellHeight = 24; cell.attachmentView.accessibilityLabel = nil; } -#pragma mark - Threads +#pragma mark - MXThreadingServiceDelegate -- (void)newThreadCreated:(NSNotification *)notification +- (void)threadingService:(MXThreadingService *)service didCreateNewThread:(MXThread *)thread direction:(MXTimelineDirection)direction { if (self.threadId) { // no need to reload the thread screen return; } + if (direction == MXTimelineDirectionBackwards) + { + // no need to reload when paginating back + return; + } NSUInteger count = 0; @synchronized (bubbles) { diff --git a/Riot/Modules/Room/TimelineCells/BaseRoomCell/BaseRoomCell.swift b/Riot/Modules/Room/TimelineCells/BaseRoomCell/BaseRoomCell.swift index f3a9ddbea..419adb969 100644 --- a/Riot/Modules/Room/TimelineCells/BaseRoomCell/BaseRoomCell.swift +++ b/Riot/Modules/Room/TimelineCells/BaseRoomCell/BaseRoomCell.swift @@ -124,7 +124,7 @@ class BaseRoomCell: MXKRoomBubbleTableViewCell, BaseRoomCellProtocol { } } - override var readMarkerViewLeadingConstraint: NSLayoutConstraint! { + override var readMarkerViewLeadingConstraint: NSLayoutConstraint? { get { if self is RoomCellReadMarkerDisplayable { return self.roomCellContentView?.readMarkerViewLeadingConstraint @@ -141,7 +141,7 @@ class BaseRoomCell: MXKRoomBubbleTableViewCell, BaseRoomCellProtocol { } } - override var readMarkerViewTrailingConstraint: NSLayoutConstraint! { + override var readMarkerViewTrailingConstraint: NSLayoutConstraint? { get { if self is RoomCellReadMarkerDisplayable { return self.roomCellContentView?.readMarkerViewTrailingConstraint diff --git a/Riot/Modules/Room/TimelineCells/Common/MXKRoomBubbleTableViewCell.h b/Riot/Modules/Room/TimelineCells/Common/MXKRoomBubbleTableViewCell.h index e79c2b721..8e247835f 100644 --- a/Riot/Modules/Room/TimelineCells/Common/MXKRoomBubbleTableViewCell.h +++ b/Riot/Modules/Room/TimelineCells/Common/MXKRoomBubbleTableViewCell.h @@ -228,11 +228,11 @@ extern NSString *const kMXKRoomBubbleCellUrlItemInteraction; /** The read marker view and its layout constraints (nil by default). */ -@property (nonatomic) UIView *readMarkerView; -@property (nonatomic) NSLayoutConstraint *readMarkerViewTopConstraint; -@property (nonatomic) NSLayoutConstraint *readMarkerViewLeadingConstraint; -@property (nonatomic) NSLayoutConstraint *readMarkerViewTrailingConstraint; -@property (nonatomic) NSLayoutConstraint *readMarkerViewHeightConstraint; +@property (nonatomic, nullable) UIView *readMarkerView; +@property (nonatomic, nullable) NSLayoutConstraint *readMarkerViewTopConstraint; +@property (nonatomic, nullable) NSLayoutConstraint *readMarkerViewLeadingConstraint; +@property (nonatomic, nullable) NSLayoutConstraint *readMarkerViewTrailingConstraint; +@property (nonatomic, nullable) NSLayoutConstraint *readMarkerViewHeightConstraint; /** The potential webview used to render an attachment (for example an animated gif). diff --git a/Riot/Modules/Room/TimelineCells/Styles/Plain/PlainRoomTimelineCellDecorator.swift b/Riot/Modules/Room/TimelineCells/Styles/Plain/PlainRoomTimelineCellDecorator.swift index 00d1f0edd..d081a24fa 100644 --- a/Riot/Modules/Room/TimelineCells/Styles/Plain/PlainRoomTimelineCellDecorator.swift +++ b/Riot/Modules/Room/TimelineCells/Styles/Plain/PlainRoomTimelineCellDecorator.swift @@ -273,8 +273,8 @@ class PlainRoomTimelineCellDecorator: RoomTimelineCellDecorator { let readMarkerContainerViewHalfWidth = readMarkerContainerView.frame.size.width/2 - cell.readMarkerViewLeadingConstraint.constant = readMarkerContainerViewHalfWidth - cell.readMarkerViewTrailingConstraint.constant = -readMarkerContainerViewHalfWidth + cell.readMarkerViewLeadingConstraint?.constant = readMarkerContainerViewHalfWidth + cell.readMarkerViewTrailingConstraint?.constant = -readMarkerContainerViewHalfWidth UIView.animate(withDuration: 1.5, delay: 0.3,