From 8662e7d511e02be03f392c1f5c9ec5597d53cc84 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Tue, 14 Jul 2020 16:11:32 +0300 Subject: [PATCH 01/10] Enable lazy loading by default --- Riot/AppDelegate.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index efed5f883..dc5417dd3 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -509,6 +509,9 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni // Disable CallKit [MXKAppSettings standardAppSettings].enableCallKit = NO; + + // Enable lazy loading + [MXKAppSettings standardAppSettings].syncWithLazyLoadOfRoomMembers = YES; self.pushNotificationService = [PushNotificationService new]; self.pushNotificationService.delegate = self; From d7bcef51d61a55259fe510cb73d252b7b39b8d41 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Tue, 14 Jul 2020 16:11:57 +0300 Subject: [PATCH 02/10] Remove lazy loading labs setting --- .../Modules/Settings/SettingsViewController.m | 79 +------------------ 1 file changed, 2 insertions(+), 77 deletions(-) diff --git a/Riot/Modules/Settings/SettingsViewController.m b/Riot/Modules/Settings/SettingsViewController.m index be33654b8..b56d4957b 100644 --- a/Riot/Modules/Settings/SettingsViewController.m +++ b/Riot/Modules/Settings/SettingsViewController.m @@ -131,8 +131,7 @@ enum enum { - LABS_USE_ROOM_MEMBERS_LAZY_LOADING_INDEX = 0, - LABS_USE_JITSI_WIDGET_INDEX, + LABS_USE_JITSI_WIDGET_INDEX = 0, LABS_COUNT }; @@ -2136,21 +2135,7 @@ SettingsIdentityServerCoordinatorBridgePresenterDelegate> } else if (section == SETTINGS_SECTION_LABS_INDEX) { - if (row == LABS_USE_ROOM_MEMBERS_LAZY_LOADING_INDEX) - { - MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath]; - - labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_labs_room_members_lazy_loading", @"Vector", nil); - - MXKAccount* account = [MXKAccountManager sharedManager].activeAccounts.firstObject; - labelAndSwitchCell.mxkSwitch.on = account.mxSession.syncWithLazyLoadOfRoomMembers; - labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; - - [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleSyncWithLazyLoadOfRoomMembers:) forControlEvents:UIControlEventTouchUpInside]; - - cell = labelAndSwitchCell; - } - else if (row == LABS_USE_JITSI_WIDGET_INDEX) + if (row == LABS_USE_JITSI_WIDGET_INDEX) { MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath]; @@ -2942,66 +2927,6 @@ SettingsIdentityServerCoordinatorBridgePresenterDelegate> } } -- (void)toggleSyncWithLazyLoadOfRoomMembers:(id)sender -{ - if (sender && [sender isKindOfClass:UISwitch.class]) - { - UISwitch *switchButton = (UISwitch*)sender; - - if (!switchButton.isOn) - { - // Disable LL and reload - [MXKAppSettings standardAppSettings].syncWithLazyLoadOfRoomMembers = NO; - [self launchClearCache]; - } - else - { - switchButton.enabled = NO; - [self startActivityIndicator]; - - // Check the user homeserver supports lazy-loading - MXKAccount* account = [MXKAccountManager sharedManager].activeAccounts.firstObject; - - MXWeakify(self); - [account supportLazyLoadOfRoomMembers:^(BOOL supportLazyLoadOfRoomMembers) { - MXStrongifyAndReturnIfNil(self); - - if (supportLazyLoadOfRoomMembers) - { - // Lazy-loading is fully supported, enable it - [MXKAppSettings standardAppSettings].syncWithLazyLoadOfRoomMembers = YES; - [self launchClearCache]; - } - else - { - [switchButton setOn:NO animated:YES]; - switchButton.enabled = YES; - [self stopActivityIndicator]; - - // No support of lazy-loading, do not engage it and warn the user - [self->currentAlert dismissViewControllerAnimated:NO completion:nil]; - - self->currentAlert = [UIAlertController alertControllerWithTitle:nil - message:NSLocalizedStringFromTable(@"settings_labs_room_members_lazy_loading_error_message", @"Vector", nil) - preferredStyle:UIAlertControllerStyleAlert]; - - MXWeakify(self); - [self->currentAlert addAction:[UIAlertAction actionWithTitle:[NSBundle mxk_localizedStringForKey:@"ok"] - style:UIAlertActionStyleDefault - handler:^(UIAlertAction * action) { - MXStrongifyAndReturnIfNil(self); - self->currentAlert = nil; - }]]; - - [self->currentAlert mxk_setAccessibilityIdentifier: @"SettingsVCNoHSSupportOfLazyLoading"]; - [self presentViewController:self->currentAlert animated:YES completion:nil]; - } - }]; - } - } -} - - - (void)toggleJitsiForConference:(id)sender { if (sender && [sender isKindOfClass:UISwitch.class]) From 07e123696ceadbdcfa43b06dbb28863b6eef7a67 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Tue, 14 Jul 2020 16:15:13 +0300 Subject: [PATCH 03/10] Update CHANGES.rst --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.rst b/CHANGES.rst index dab2ce787..174a1e26f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,6 +6,7 @@ Improvements: * Theme: Customize UISearchBar with new iOS 13 properties (#3270). * NSE: Make extension reusable (#3326). * Strings: Use you instead of display name on notice events (#3282). + * Lazy-loading: Remove lazy loading labs setting, enable it by default (#3389). Bug fix: * Xcode11: Fix content change error when dragging start chat page (PR #3075). From b3a2420f6699c60dc4c0d2ca466adf1915672b18 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Wed, 15 Jul 2020 14:28:51 +0300 Subject: [PATCH 04/10] Set storyboard id for SettingsViewController --- Riot/Assets/Base.lproj/Main.storyboard | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Riot/Assets/Base.lproj/Main.storyboard b/Riot/Assets/Base.lproj/Main.storyboard index 21786c705..edbc4639f 100644 --- a/Riot/Assets/Base.lproj/Main.storyboard +++ b/Riot/Assets/Base.lproj/Main.storyboard @@ -324,7 +324,7 @@ - + From 276a538643e23ed7ccaee834e85d4eac0a7d54a1 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Wed, 15 Jul 2020 14:29:41 +0300 Subject: [PATCH 05/10] Update CHANGES.rst --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.rst b/CHANGES.rst index dab2ce787..550809159 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -31,6 +31,7 @@ Bug fix: * Xcode11: Disable voip background mode to avoid VoIP pushes (#3369). * Xcode11: Disable key backup on push extension (#3371). * RoomMembershipBubbleCell: Fix message textview leading constraint (#3226). + * Main.storyboard: Set storyboard identifier for SettingsViewController (#3398). Changes in 0.11.6 (2020-06-30) =============================================== From 19e5dd5412504f2f9313367ddf07b49a64d9d0ab Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Wed, 15 Jul 2020 16:13:59 +0300 Subject: [PATCH 06/10] Scroll to next section if discovery is not ready yet, fixes #3401 --- Riot/Modules/Settings/SettingsViewController.m | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Riot/Modules/Settings/SettingsViewController.m b/Riot/Modules/Settings/SettingsViewController.m index be33654b8..ce8b9e58b 100644 --- a/Riot/Modules/Settings/SettingsViewController.m +++ b/Riot/Modules/Settings/SettingsViewController.m @@ -2471,8 +2471,18 @@ SettingsIdentityServerCoordinatorBridgePresenterDelegate> } else if (section == SETTINGS_SECTION_USER_SETTINGS_INDEX && row == userSettingsThreePidsInformation) { - NSIndexPath *discoveryIndexPath = [NSIndexPath indexPathForRow:0 inSection:SETTINGS_SECTION_DISCOVERY_INDEX]; - [tableView scrollToRowAtIndexPath:discoveryIndexPath atScrollPosition:UITableViewScrollPositionTop animated:YES]; + // settingsDiscoveryTableViewSection is a dynamic section, so check number of rows before scroll to avoid crashes + if (self.settingsDiscoveryTableViewSection.numberOfRows > 0) + { + NSIndexPath *discoveryIndexPath = [NSIndexPath indexPathForRow:0 inSection:SETTINGS_SECTION_DISCOVERY_INDEX]; + [tableView scrollToRowAtIndexPath:discoveryIndexPath atScrollPosition:UITableViewScrollPositionTop animated:YES]; + } + else + { + // this won't be precise in scroll location, but seems the best option for now + NSIndexPath *discoveryIndexPath = [NSIndexPath indexPathForRow:0 inSection:SETTINGS_SECTION_DISCOVERY_INDEX + 1]; + [tableView scrollToRowAtIndexPath:discoveryIndexPath atScrollPosition:UITableViewScrollPositionMiddle animated:YES]; + } } else if (section == SETTINGS_SECTION_DISCOVERY_INDEX) { From 0103eb32e2184885e5d85b67984703f965e9c4fa Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Wed, 15 Jul 2020 16:14:42 +0300 Subject: [PATCH 07/10] Update CHANGES.rst --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.rst b/CHANGES.rst index dab2ce787..97414fcac 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -31,6 +31,7 @@ Bug fix: * Xcode11: Disable voip background mode to avoid VoIP pushes (#3369). * Xcode11: Disable key backup on push extension (#3371). * RoomMembershipBubbleCell: Fix message textview leading constraint (#3226). + * SettingsViewController: Fix crash when scrolling to Discovery (#3401). Changes in 0.11.6 (2020-06-30) =============================================== From f27a6f2a4e7ff1dddeaa036f590552127fe28923 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Thu, 16 Jul 2020 12:35:49 +0300 Subject: [PATCH 08/10] Add license for FlowCommoniOS --- Riot/Assets/third_party_licenses.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Riot/Assets/third_party_licenses.html b/Riot/Assets/third_party_licenses.html index 37848b595..7f8dacd5c 100644 --- a/Riot/Assets/third_party_licenses.html +++ b/Riot/Assets/third_party_licenses.html @@ -1425,6 +1425,28 @@ THE SOFTWARE.

+
  • + FlowCommoniOS (https://github.com/createwithflow/FlowCommoniOS) +

    FlowCommoniOS is a set of common files for Flow Animations. +

    It is released under the MIT license. +

    Copyright © 2016-2020 JABT Labs Inc. +

    Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: +

    The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. +

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +

    +
  • From 04573157c34693d4aef778f2979d1d37dd19ee12 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Thu, 16 Jul 2020 12:37:29 +0300 Subject: [PATCH 09/10] Update CHANGES.rst --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.rst b/CHANGES.rst index dab2ce787..d4d1bb6d5 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,6 +6,7 @@ Improvements: * Theme: Customize UISearchBar with new iOS 13 properties (#3270). * NSE: Make extension reusable (#3326). * Strings: Use you instead of display name on notice events (#3282). + * Third-party licences: Add license for FlowCommoniOS (#3415). Bug fix: * Xcode11: Fix content change error when dragging start chat page (PR #3075). From bd068e3586805e6025c26c82739bb8ba72a2fd46 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Thu, 16 Jul 2020 13:06:52 +0300 Subject: [PATCH 10/10] Remove unused strings --- Riot/Assets/en.lproj/Vector.strings | 2 -- Riot/Generated/Strings.swift | 8 -------- 2 files changed, 10 deletions(-) diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index ead991796..24580626d 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -482,8 +482,6 @@ "settings_labs_e2e_encryption" = "End-to-End Encryption"; "settings_labs_e2e_encryption_prompt_message" = "To finish setting up encryption you must log in again."; -"settings_labs_room_members_lazy_loading" = "Lazy load rooms members"; -"settings_labs_room_members_lazy_loading_error_message" = "Your homeserver does not support lazy loading of room members yet. Try later."; "settings_labs_create_conference_with_jitsi" = "Create conference calls with jitsi"; "settings_labs_message_reaction" = "React to messages with emoji"; diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index b3d35b061..bff9cbcfd 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -3674,14 +3674,6 @@ internal enum VectorL10n { internal static var settingsLabsMessageReaction: String { return VectorL10n.tr("Vector", "settings_labs_message_reaction") } - /// Lazy load rooms members - internal static var settingsLabsRoomMembersLazyLoading: String { - return VectorL10n.tr("Vector", "settings_labs_room_members_lazy_loading") - } - /// Your homeserver does not support lazy loading of room members yet. Try later. - internal static var settingsLabsRoomMembersLazyLoadingErrorMessage: String { - return VectorL10n.tr("Vector", "settings_labs_room_members_lazy_loading_error_message") - } /// Mark all messages as read internal static var settingsMarkAllAsRead: String { return VectorL10n.tr("Vector", "settings_mark_all_as_read")