diff --git a/AUTHORS.rst b/AUTHORS.rst index a119fa427..b68079ea7 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -35,4 +35,7 @@ Dawid Rączka Evan Tang * PR #1737 Cancel Buttons use style Cancel + +Joey Watts + * PR #1777 Add support for interactive notifications \ No newline at end of file diff --git a/CHANGES.rst b/CHANGES.rst index dcfa6a2e9..36f107dba 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,24 @@ +Changes in 0.6.12 (2018-03-12) +=============================================== + +Improvements: + * Upgrade MatrixKit version (v0.7.8). + * Add Catalan, thanks to @salvadorpla. + * Add Bulgarian, thanks to @rbozhkova. + * Add quick reply to notifications (#625), thanks to @joeywatts(PR #1777). + * Room: Inform user when they cannot post to a room because of low power level. + * Matrix Apps: Enable them by default. Remove the settings from LABS section (#1795). + * Improve server load on event redaction (vector-im/riot-ios#1730). + +Bug Fix: + * Push: Missing push notifications after answering a call (vector-im/riot-ios#1757). + * Fix screen flashing at startup (#1798). + * Cannot join from a room preview for room with a long topic (#1645). + * Groups: Room summary should not display notices about groups (vector-im/riot-ios#1780). + * MXKEventFormatter: Emotes which contain a single emoji are expanded to be enormous (vector-im/riot-ios#1558). + * Crypto: e2e devices list not shown (#1782). + * Direct Chat: a room was marked as direct by mistake when I joined it. + Changes in 0.6.11 (2018-02-27) =============================================== diff --git a/Podfile b/Podfile index a0df46413..39c47abfc 100644 --- a/Podfile +++ b/Podfile @@ -9,7 +9,7 @@ source 'https://github.com/CocoaPods/Specs.git' # Different flavours of pods to MatrixKit # The current MatrixKit pod version -$matrixKitVersion = '0.7.7' +$matrixKitVersion = '0.7.8' # The develop branch version #$matrixKitVersion = 'develop' diff --git a/Podfile.lock b/Podfile.lock index e08878664..09f676b66 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -43,34 +43,34 @@ PODS: - GZIP (1.2.1) - HPGrowingTextView (1.1) - libPhoneNumber-iOS (0.9.13) - - MatrixKit (0.7.7): + - MatrixKit (0.7.8): - cmark (~> 0.24.1) - - DTCoreText (~> 1.6.17) + - DTCoreText (~> 1.6.21) - HPGrowingTextView (~> 1.1) - - libPhoneNumber-iOS (~> 0.9.10) - - MatrixKit/Core (= 0.7.7) - - MatrixSDK (= 0.10.5) - - MatrixKit/AppExtension (0.7.7): + - libPhoneNumber-iOS (~> 0.9.13) + - MatrixKit/Core (= 0.7.8) + - MatrixSDK (= 0.10.6) + - MatrixKit/AppExtension (0.7.8): - cmark (~> 0.24.1) - - DTCoreText (~> 1.6.17) + - DTCoreText (~> 1.6.21) - DTCoreText/Extension - HPGrowingTextView (~> 1.1) - - libPhoneNumber-iOS (~> 0.9.10) - - MatrixSDK (= 0.10.5) - - MatrixKit/Core (0.7.7): + - libPhoneNumber-iOS (~> 0.9.13) + - MatrixSDK (= 0.10.6) + - MatrixKit/Core (0.7.8): - cmark (~> 0.24.1) - - DTCoreText (~> 1.6.17) + - DTCoreText (~> 1.6.21) - HPGrowingTextView (~> 1.1) - - libPhoneNumber-iOS (~> 0.9.10) - - MatrixSDK (= 0.10.5) - - MatrixSDK (0.10.5): - - MatrixSDK/Core (= 0.10.5) - - MatrixSDK/Core (0.10.5): + - libPhoneNumber-iOS (~> 0.9.13) + - MatrixSDK (= 0.10.6) + - MatrixSDK (0.10.6): + - MatrixSDK/Core (= 0.10.6) + - MatrixSDK/Core (0.10.6): - AFNetworking (~> 3.2.0) - GZIP (~> 1.2.1) - OLMKit (~> 2.2.2) - - Realm (~> 3.1.0) - - MatrixSDK/JingleCallStack (0.10.5): + - Realm (~> 3.1.1) + - MatrixSDK/JingleCallStack (0.10.6): - MatrixSDK/Core - WebRTC (= 63.11.20455) - OLMKit (2.2.2): @@ -90,8 +90,8 @@ DEPENDENCIES: - cmark - DTCoreText - GBDeviceInfo (~> 5.1.0) - - MatrixKit (= 0.7.7) - - MatrixKit/AppExtension (= 0.7.7) + - MatrixKit (= 0.7.8) + - MatrixKit/AppExtension (= 0.7.8) - MatrixSDK/JingleCallStack - OLMKit - PiwikTracker (from `https://github.com/manuroe/matomo-sdk-ios.git`, branch `feature/CustomVariables`) @@ -115,13 +115,13 @@ SPEC CHECKSUMS: GZIP: 7ee835f989fb3c6ea79005fc90b8fa6af710a70d HPGrowingTextView: 88a716d97fb853bcb08a4a08e4727da17efc9b19 libPhoneNumber-iOS: e444379ac18bbfbdefad571da735b2cd7e096caa - MatrixKit: c1b7e4d181fff789ce5fc449b934a37a148e5820 - MatrixSDK: ad1f2b3f183ad328a8a0ab7b3f8aa13bc145d141 + MatrixKit: 4a44fc7c77b312d921604af249c891144b228d5c + MatrixSDK: 9d2edb30d020fb8478e03d5b69097b7ce273bc63 OLMKit: b9d8c0ffee9ea8c45bc0aaa9afb47f93fba7efbd PiwikTracker: 42862c7b13028065c3dfd36b4dc38db8a5765acf Realm: 42d1c38a5b1bbcc828b48a7ce702cb86fc68adf4 WebRTC: f2a6203584745fe53532633397557876b5d71640 -PODFILE CHECKSUM: c9f36b49408c561b35967a17d6d35e9ca7962b33 +PODFILE CHECKSUM: 4a8ff7d0d54b2e3369a8e4d32f2814e24404033f COCOAPODS: 1.4.0 diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index 67475d3a9..195b7a4d2 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -2468,7 +2468,13 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN if (mxSession) { // Report this session to contact manager - [[MXKContactManager sharedManager] addMatrixSession:mxSession]; + // But wait a bit that our launch animation screen is ready to show and + // displayed if needed. As the processing in MXKContactManager can lock + // the UI thread for several seconds, it is better to show the animation + // during this blocking task. + dispatch_after(dispatch_walltime(DISPATCH_TIME_NOW, 0.3 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ + [[MXKContactManager sharedManager] addMatrixSession:mxSession]; + }); // Update home data sources [_masterTabBarController addMatrixSession:mxSession]; diff --git a/Riot/Assets/bg.lproj/Vector.strings b/Riot/Assets/bg.lproj/Vector.strings index 8b37375fe..ed53cbd99 100644 --- a/Riot/Assets/bg.lproj/Vector.strings +++ b/Riot/Assets/bg.lproj/Vector.strings @@ -320,7 +320,6 @@ "settings_contacts_discover_matrix_users" = "Използване на имейл и телефонен номер за откриване на потребители"; "settings_contacts_phonebook_country" = "Държава на телефонния указател"; "settings_labs_e2e_encryption_prompt_message" = "За да завършите настройката на шифроването, трябва да влезете в профила си отново."; -"settings_labs_matrix_apps" = "Matrix приложения"; "settings_labs_create_conference_with_jitsi" = "Създаване на групови разговори с jitsi"; "settings_term_conditions" = "Правила и условия"; "settings_privacy_policy" = "Правила за поверителност"; diff --git a/Riot/Assets/ca.lproj/Vector.strings b/Riot/Assets/ca.lproj/Vector.strings index fdcbe598b..2b5485964 100644 --- a/Riot/Assets/ca.lproj/Vector.strings +++ b/Riot/Assets/ca.lproj/Vector.strings @@ -312,7 +312,6 @@ "settings_contacts_phonebook_country" = "País de la guia telefònica"; "settings_labs_e2e_encryption" = "Xifrat punt a punt"; "settings_labs_e2e_encryption_prompt_message" = "Per acabar de ajustar el xifratge has de Iniciar sessió de nou."; -"settings_labs_matrix_apps" = "Aplicacions Matrix"; "settings_labs_create_conference_with_jitsi" = "Crear trucades amb Jitsi"; "settings_version" = "Versió %@"; "settings_olm_version" = "Versió Olm %@"; diff --git a/Riot/Assets/de.lproj/Vector.strings b/Riot/Assets/de.lproj/Vector.strings index 501f44e6e..580951c73 100644 --- a/Riot/Assets/de.lproj/Vector.strings +++ b/Riot/Assets/de.lproj/Vector.strings @@ -439,7 +439,6 @@ "send_to" = "Sende an %@"; "sending" = "Senden"; "room_event_failed_to_send" = "Senden fehlgeschlagen"; -"settings_labs_matrix_apps" = "Matrix Apps"; "room_details_direct_chat" = "Direkter Chat"; "room_details_fail_to_update_room_direct" = "Setzen der Direkt-Kennzeichnung in diesem Raum fehlgeschlagen"; "event_formatter_widget_added" = "Widget %@ wurde von %@ hinzugefügt"; diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index bbb4c8301..f8fe3a6a5 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -366,7 +366,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_matrix_apps" = "Matrix Apps"; "settings_labs_create_conference_with_jitsi" = "Create conference calls with jitsi"; "settings_version" = "Version %@"; diff --git a/Riot/Assets/eu.lproj/Vector.strings b/Riot/Assets/eu.lproj/Vector.strings index 4cc05b3eb..21371ecd9 100644 --- a/Riot/Assets/eu.lproj/Vector.strings +++ b/Riot/Assets/eu.lproj/Vector.strings @@ -449,7 +449,6 @@ "settings_ui_theme_black" = "Beltza"; "settings_ui_theme_picker_title" = "Hautatu itxura bat"; "settings_ui_theme_picker_message" = "\"Automatikoa\"-k gailuaren \"alderantzikatu koloreak\" ezarpena erabiltzen du"; -"settings_labs_matrix_apps" = "Matrix aplikazioak"; "settings_enable_rageshake" = "Astindu amorruz akatsaren berri emateko"; "room_details_direct_chat" = "Txat zuzena"; "event_formatter_widget_added" = "%@ trepeta gehitu du %@ erabiltzaileak"; diff --git a/Riot/Assets/fr.lproj/Vector.strings b/Riot/Assets/fr.lproj/Vector.strings index 4f49a12e5..73ae99c36 100644 --- a/Riot/Assets/fr.lproj/Vector.strings +++ b/Riot/Assets/fr.lproj/Vector.strings @@ -481,7 +481,6 @@ "widget_integration_room_not_visible" = "Le salon %@ n'est pas visible."; "auth_share_extension_prompt" = "Se connecter dans l'application principale pour partager du contenu"; "room_event_failed_to_send" = "Échec de l'envoi"; -"settings_labs_matrix_apps" = "Applications Matrix"; "event_formatter_jitsi_widget_added" = "Téléconférence en Voix sur IP ajoutée par %@"; "event_formatter_jitsi_widget_removed" = "Téléconférence en Voix sur IP supprimée par %@"; // Widget Integration Manager diff --git a/Riot/Assets/nl.lproj/Vector.strings b/Riot/Assets/nl.lproj/Vector.strings index c301e9cc1..5c5fae6a3 100644 --- a/Riot/Assets/nl.lproj/Vector.strings +++ b/Riot/Assets/nl.lproj/Vector.strings @@ -473,7 +473,6 @@ "settings_ui_theme_black" = "Zwart"; "settings_ui_theme_picker_title" = "Selecteer een thema"; "settings_ui_theme_picker_message" = "\"Automatisch\" gebruikt de \"Kleurweergave omkeren\" instelling van je apparaat"; -"settings_labs_matrix_apps" = "Matrix Applicaties"; "settings_enable_rageshake" = "Schud de telefoon om een fout te rapporteren"; "room_details_direct_chat" = "Privégesprek"; "room_details_fail_to_update_room_direct" = "Het is niet gelukt om de direct (privé) vlag in deze ruimte te updaten"; diff --git a/Riot/Assets/ru.lproj/Vector.strings b/Riot/Assets/ru.lproj/Vector.strings index f735c5ae5..5193b65dc 100644 --- a/Riot/Assets/ru.lproj/Vector.strings +++ b/Riot/Assets/ru.lproj/Vector.strings @@ -435,7 +435,6 @@ "sending" = "Отправка"; "auth_share_extension_prompt" = "Войти в основное приложение для совместного использования контента"; "room_event_failed_to_send" = "Не удалось отправить"; -"settings_labs_matrix_apps" = "Приложения Matrix"; "room_details_direct_chat" = "Прямой чат"; "room_details_fail_to_update_room_direct" = "Не удается обновить прямой флаг этой комнаты"; "event_formatter_jitsi_widget_added" = "Конференция добавлена %@"; diff --git a/Riot/Assets/vi.lproj/Vector.strings b/Riot/Assets/vi.lproj/Vector.strings index b3e681924..6c0b35805 100644 --- a/Riot/Assets/vi.lproj/Vector.strings +++ b/Riot/Assets/vi.lproj/Vector.strings @@ -306,7 +306,6 @@ "settings_contacts_phonebook_country" = "Quốc gia trong danh bạ"; "settings_labs_e2e_encryption" = "End-to-End Mã Hóa"; "settings_labs_e2e_encryption_prompt_message" = "Để hoàn thành cài đặt mã hóa, bạn phải đăng nhập lại."; -"settings_labs_matrix_apps" = "Ứng dụng Matrix"; "settings_labs_create_conference_with_jitsi" = "Tạo cuộc gọi hội họp bằng jitsi"; "settings_version" = "Phiên bản %@"; "settings_olm_version" = "Phiên bản Olm %@"; diff --git a/Riot/Assets/zh_Hans.lproj/Vector.strings b/Riot/Assets/zh_Hans.lproj/Vector.strings index 69b6d358d..ca449eb88 100644 --- a/Riot/Assets/zh_Hans.lproj/Vector.strings +++ b/Riot/Assets/zh_Hans.lproj/Vector.strings @@ -443,5 +443,4 @@ "settings_ui_theme_black" = "纯黑"; "settings_ui_theme_picker_title" = "选择一个主题"; "settings_ui_theme_picker_message" = "“自动”表示使用设备的“反色”设置"; -"settings_labs_matrix_apps" = "Matrix 应用"; "settings_labs_create_conference_with_jitsi" = "使用 jitsi 创建一个会议通话"; diff --git a/Riot/Info.plist b/Riot/Info.plist index dc1d824ac..70f7e130d 100644 --- a/Riot/Info.plist +++ b/Riot/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.6.11 + 0.6.12 CFBundleSignature ???? CFBundleVersion - 0.6.11 + 0.6.12 ITSAppUsesNonExemptEncryption ITSEncryptionExportComplianceCode diff --git a/Riot/Riot-Defaults.plist b/Riot/Riot-Defaults.plist index a8590fe54..ef435a321 100644 --- a/Riot/Riot-Defaults.plist +++ b/Riot/Riot-Defaults.plist @@ -26,6 +26,8 @@ https://riot.im/beta webAppUrl https://riot.im/app + matrixApps + integrationsUiUrl https://scalar-staging.riot.im/scalar-web/ integrationsRestUrl diff --git a/Riot/ViewController/RoomViewController.m b/Riot/ViewController/RoomViewController.m index 004881301..b434af949 100644 --- a/Riot/ViewController/RoomViewController.m +++ b/Riot/ViewController/RoomViewController.m @@ -1227,11 +1227,8 @@ // Set the right room title view if (self.isRoomPreview) { - // Disable the right buttons - for (UIBarButtonItem *barButtonItem in self.navigationItem.rightBarButtonItems) - { - barButtonItem.enabled = NO; - } + // Do not show the right buttons + self.navigationItem.rightBarButtonItems = nil; [self showPreviewHeader:YES]; } @@ -1583,7 +1580,8 @@ { if (previewHeader) { - if (isLandscapeOriented) + if (isLandscapeOriented + && [GBDeviceInfo deviceInfo].family != GBDeviceFamilyiPad) { CGRect frame = self.navigationController.navigationBar.frame; @@ -1605,7 +1603,32 @@ { previewHeader.mainHeaderContainer.hidden = NO; previewHeader.mainHeaderBackgroundHeightConstraint.constant = previewHeader.mainHeaderContainer.frame.size.height; - + + if ([previewHeader isKindOfClass:PreviewRoomTitleView.class]) + { + // In case of preview, update the header height so that we can + // display as much as possible the room topic in this header. + // Note: the header height is handled by the previewHeader.mainHeaderBackgroundHeightConstraint. + PreviewRoomTitleView *previewRoomTitleView = (PreviewRoomTitleView *)previewHeader; + + // Compute the height required to display all the room topic + CGSize sizeThatFitsTextView = [previewRoomTitleView.roomTopic sizeThatFits:CGSizeMake(previewRoomTitleView.roomTopic.frame.size.width, MAXFLOAT)]; + + // Increase the preview header height according to the room topic height + // but limit it in order to let room for room messages at the screen bottom. + // This free space depends on the device. + // On an iphone 5 screen, the room topic height cannot be more than 50px. + // Then, on larger screen, we can allow it a bit more height but we + // apply a factor to give more priority to the display of more messages. + CGFloat screenHeight = [[UIScreen mainScreen] bounds].size.height; + CGFloat maxRoomTopicHeight = 50 + (screenHeight - 568) / 3; + + CGFloat additionalHeight = MIN(maxRoomTopicHeight, sizeThatFitsTextView.height) + - previewRoomTitleView.roomTopic.frame.size.height; + + previewHeader.mainHeaderBackgroundHeightConstraint.constant += additionalHeight; + } + [self setRoomTitleViewClass:RoomAvatarTitleView.class]; // Note the avatar title view does not define tap gesture. diff --git a/Riot/ViewController/SettingsViewController.m b/Riot/ViewController/SettingsViewController.m index becd42595..d196e052d 100644 --- a/Riot/ViewController/SettingsViewController.m +++ b/Riot/ViewController/SettingsViewController.m @@ -112,8 +112,7 @@ enum enum { - LABS_MATRIX_APPS_INDEX = 0, - LABS_USE_JITSI_WIDGET_INDEX, + LABS_USE_JITSI_WIDGET_INDEX = 0, LABS_CRYPTO_INDEX, LABS_COUNT }; @@ -2024,18 +2023,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(); } else if (section == SETTINGS_SECTION_LABS_INDEX) { - if (row == LABS_MATRIX_APPS_INDEX) - { - MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath]; - - labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_labs_matrix_apps", @"Vector", nil); - labelAndSwitchCell.mxkSwitch.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"matrixApps"]; - - [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleLabsMatrixApps:) 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]; @@ -2881,19 +2869,6 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(); } } -- (void)toggleLabsMatrixApps:(id)sender -{ - if (sender && [sender isKindOfClass:UISwitch.class]) - { - UISwitch *switchButton = (UISwitch*)sender; - - [[NSUserDefaults standardUserDefaults] setBool:switchButton.isOn forKey:@"matrixApps"]; - [[NSUserDefaults standardUserDefaults] synchronize]; - - [self.tableView reloadData]; - } -} - - (void)toggleJitsiForConference:(id)sender { if (sender && [sender isKindOfClass:UISwitch.class]) diff --git a/Riot/Views/RoomTitle/PreviewRoomTitleView.h b/Riot/Views/RoomTitle/PreviewRoomTitleView.h index 619fc90b7..79fdde1bb 100644 --- a/Riot/Views/RoomTitle/PreviewRoomTitleView.h +++ b/Riot/Views/RoomTitle/PreviewRoomTitleView.h @@ -24,7 +24,7 @@ @property (weak, nonatomic) IBOutlet UIView *mainHeaderContainer; @property (weak, nonatomic) IBOutlet MXKImageView *roomAvatar; -@property (weak, nonatomic) IBOutlet UILabel *roomTopic; +@property (weak, nonatomic) IBOutlet UITextView *roomTopic; @property (weak, nonatomic) IBOutlet UILabel *roomMembers; @property (weak, nonatomic) IBOutlet UIView *roomMembersDetailsIcon; diff --git a/Riot/Views/RoomTitle/PreviewRoomTitleView.m b/Riot/Views/RoomTitle/PreviewRoomTitleView.m index 1e8888d46..6281e750e 100644 --- a/Riot/Views/RoomTitle/PreviewRoomTitleView.m +++ b/Riot/Views/RoomTitle/PreviewRoomTitleView.m @@ -67,7 +67,6 @@ self.displayNameTextField.textColor = (self.mxRoom.summary.displayname.length ? kRiotPrimaryTextColor : kRiotSecondaryTextColor); self.roomTopic.textColor = kRiotTopicTextColor; - self.roomTopic.numberOfLines = 0; self.roomMembers.textColor = kRiotColorGreen; @@ -106,6 +105,10 @@ // Room topic self.roomTopic.text = self.roomPreviewData.roomTopic; + + [UIView setAnimationsEnabled:NO]; + [self.roomTopic scrollRangeToVisible:NSMakeRange(0, 0)]; + [UIView setAnimationsEnabled:YES]; // Joined members count if (self.roomPreviewData.numJoinedMembers > 1) @@ -148,6 +151,14 @@ { roomName = NSLocalizedStringFromTable(@"room_preview_try_join_an_unknown_room_default", @"Vector", nil); } + else if (roomName.length > 20) + { + // Would have been nice to get the cropped string displayed by + // self.displayNameTextField but the value is not accessible. + // Cut it off by hand + roomName = [NSString stringWithFormat:@"%@…",[roomName substringToIndex:20]]; + } + self.previewLabel.text = [NSString stringWithFormat:NSLocalizedStringFromTable(@"room_preview_try_join_an_unknown_room", @"Vector", nil), roomName]; } } diff --git a/Riot/Views/RoomTitle/PreviewRoomTitleView.xib b/Riot/Views/RoomTitle/PreviewRoomTitleView.xib index 2cb75c155..31fcca273 100644 --- a/Riot/Views/RoomTitle/PreviewRoomTitleView.xib +++ b/Riot/Views/RoomTitle/PreviewRoomTitleView.xib @@ -1,11 +1,11 @@ - + - + @@ -47,22 +47,22 @@ - -