From c1dcb2b88336da65b19a4de1a85cbfdf15a808b7 Mon Sep 17 00:00:00 2001 From: Doug Date: Wed, 23 Feb 2022 11:13:29 +0000 Subject: [PATCH 1/7] Revert change to UnifiedSearchRecentsDataSource Rename `init` to `initWithMatrixSession:recentsListService:` --- .../DataSources/UnifiedSearchRecentsDataSource.m | 12 ++++++++++++ changelog.d/5672.bugfix | 1 + 2 files changed, 13 insertions(+) create mode 100644 changelog.d/5672.bugfix 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/changelog.d/5672.bugfix b/changelog.d/5672.bugfix new file mode 100644 index 000000000..ec560f304 --- /dev/null +++ b/changelog.d/5672.bugfix @@ -0,0 +1 @@ +Unified Search: Fix a bug where the room directory wasn't working. \ No newline at end of file From b598508302744ff1786b5df7481d28678c4d812a Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 23 Feb 2022 13:23:42 +0200 Subject: [PATCH 2/7] Fixes vector-im/element-ios/issues/5673 - Implicitly unwrapped optionals on the PlainRoomTimelineCellDecorator. --- .../Room/TimelineCells/BaseRoomCell/BaseRoomCell.swift | 4 ++-- .../TimelineCells/Common/MXKRoomBubbleTableViewCell.h | 10 +++++----- .../Styles/Plain/PlainRoomTimelineCellDecorator.swift | 4 ++-- changelog.d/5673.bugfix | 1 + 4 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 changelog.d/5673.bugfix 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, diff --git a/changelog.d/5673.bugfix b/changelog.d/5673.bugfix new file mode 100644 index 000000000..25c4eac29 --- /dev/null +++ b/changelog.d/5673.bugfix @@ -0,0 +1 @@ +Fixed crashes on implicitly unwrapped optionals in the PlainRoomTimelineCellDecorator. \ No newline at end of file From c4ddd37d57f6fafdaaec41ab3795e642958fc8b3 Mon Sep 17 00:00:00 2001 From: aringenbach <80891108+aringenbach@users.noreply.github.com> Date: Wed, 23 Feb 2022 15:23:02 +0100 Subject: [PATCH 3/7] Fix L10n not always defaulting to English (#5682) Co-authored-by: Arnaud Ringenbach --- Riot/Modules/Application/LegacyAppDelegate.m | 36 ++++++++++---------- changelog.d/5674.bugfix | 1 + 2 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 changelog.d/5674.bugfix 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/changelog.d/5674.bugfix b/changelog.d/5674.bugfix new file mode 100644 index 000000000..37aa56d67 --- /dev/null +++ b/changelog.d/5674.bugfix @@ -0,0 +1 @@ +L10n: Fix defaulting to English language From 8dca1507d02d5b56e9fffd14e27f2176b0579b68 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Thu, 24 Feb 2022 19:57:58 +0300 Subject: [PATCH 4/7] Do not reload the room data source on back pagination for new threads --- .../Modules/Room/DataSources/RoomDataSource.m | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) 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) { From fff7fc6195e20090c3bc389fe13d1e2807875b66 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Thu, 24 Feb 2022 19:59:04 +0300 Subject: [PATCH 5/7] Add changelog --- changelog.d/5694.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/5694.bugfix diff --git a/changelog.d/5694.bugfix b/changelog.d/5694.bugfix new file mode 100644 index 000000000..fdc8c7493 --- /dev/null +++ b/changelog.d/5694.bugfix @@ -0,0 +1 @@ +RoomDataSource: Do not reload room data source on back pagination for new threads. From edb92019687d02760da23b7708c5dbec781d57fa Mon Sep 17 00:00:00 2001 From: Doug Date: Fri, 25 Feb 2022 10:45:56 +0000 Subject: [PATCH 6/7] changelog.d: Upgrade MatrixSDK version ([v0.22.4](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.22.4)). --- Config/AppVersion.xcconfig | 4 ++-- Podfile | 2 +- changelog.d/x-nolink-0.change | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 changelog.d/x-nolink-0.change 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/changelog.d/x-nolink-0.change b/changelog.d/x-nolink-0.change new file mode 100644 index 000000000..5091d6122 --- /dev/null +++ b/changelog.d/x-nolink-0.change @@ -0,0 +1 @@ +Upgrade MatrixSDK version ([v0.22.4](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.22.4)). \ No newline at end of file From d1717eeb64ec706463a67da076aa31fe87ca3943 Mon Sep 17 00:00:00 2001 From: Doug Date: Fri, 25 Feb 2022 10:45:56 +0000 Subject: [PATCH 7/7] version++ --- CHANGES.md | 14 ++++++++++++++ changelog.d/5672.bugfix | 1 - changelog.d/5673.bugfix | 1 - changelog.d/5674.bugfix | 1 - changelog.d/5694.bugfix | 1 - changelog.d/x-nolink-0.change | 1 - 6 files changed, 14 insertions(+), 5 deletions(-) delete mode 100644 changelog.d/5672.bugfix delete mode 100644 changelog.d/5673.bugfix delete mode 100644 changelog.d/5674.bugfix delete mode 100644 changelog.d/5694.bugfix delete mode 100644 changelog.d/x-nolink-0.change 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/changelog.d/5672.bugfix b/changelog.d/5672.bugfix deleted file mode 100644 index ec560f304..000000000 --- a/changelog.d/5672.bugfix +++ /dev/null @@ -1 +0,0 @@ -Unified Search: Fix a bug where the room directory wasn't working. \ No newline at end of file diff --git a/changelog.d/5673.bugfix b/changelog.d/5673.bugfix deleted file mode 100644 index 25c4eac29..000000000 --- a/changelog.d/5673.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixed crashes on implicitly unwrapped optionals in the PlainRoomTimelineCellDecorator. \ No newline at end of file diff --git a/changelog.d/5674.bugfix b/changelog.d/5674.bugfix deleted file mode 100644 index 37aa56d67..000000000 --- a/changelog.d/5674.bugfix +++ /dev/null @@ -1 +0,0 @@ -L10n: Fix defaulting to English language diff --git a/changelog.d/5694.bugfix b/changelog.d/5694.bugfix deleted file mode 100644 index fdc8c7493..000000000 --- a/changelog.d/5694.bugfix +++ /dev/null @@ -1 +0,0 @@ -RoomDataSource: Do not reload room data source on back pagination for new threads. diff --git a/changelog.d/x-nolink-0.change b/changelog.d/x-nolink-0.change deleted file mode 100644 index 5091d6122..000000000 --- a/changelog.d/x-nolink-0.change +++ /dev/null @@ -1 +0,0 @@ -Upgrade MatrixSDK version ([v0.22.4](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.22.4)). \ No newline at end of file