From b5bd882ac0b32be37270017e12832a81ff1d386f Mon Sep 17 00:00:00 2001 From: Chris Moos Date: Sun, 22 Dec 2019 14:37:39 -0700 Subject: [PATCH 1/6] Fix issue with joining public rooms with no guest access. This fixes #2888. Signed-off-by: Chris Moos --- CHANGES.rst | 6 ++++++ Riot/Model/Room/RoomPreviewData.m | 11 +++++++++-- Riot/Modules/Rooms/RoomsViewController.m | 5 ++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 3349c7ebf..c2153c78b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,9 @@ +Changes in 0.10.5 (TBD) +=============================================== + +Bug fix: +* Fix error when joining some public rooms. (#2888). + Changes in 0.10.4 (2019-12-11) =============================================== diff --git a/Riot/Model/Room/RoomPreviewData.m b/Riot/Model/Room/RoomPreviewData.m index a55c0eae2..b86f1b7ef 100644 --- a/Riot/Model/Room/RoomPreviewData.m +++ b/Riot/Model/Room/RoomPreviewData.m @@ -51,12 +51,17 @@ if (self) { // Report public room data - _roomName = publicRoom.name; + _roomName = publicRoom.displayname; _roomAvatarUrl = publicRoom.avatarUrl; _roomTopic = publicRoom.topic; _roomAliases = publicRoom.aliases; _numJoinedMembers = publicRoom.numJoinedMembers; + // First try to fallback to the name if displayname isn't present + if (!_roomName.length) { + _roomName = publicRoom.name; + } + if (!_roomName.length) { // Consider the room aliases to define a default room name. @@ -109,7 +114,9 @@ } failure:^(NSError *error) { MXStrongifyAndReturnIfNil(self); - self->_roomName = self->_roomId; + if(self->_roomName == nil || self->_roomName.length == 0) { + self->_roomName = self->_roomId; + } completion(NO); }]; } diff --git a/Riot/Modules/Rooms/RoomsViewController.m b/Riot/Modules/Rooms/RoomsViewController.m index e7cab93b4..09f15cc14 100644 --- a/Riot/Modules/Rooms/RoomsViewController.m +++ b/Riot/Modules/Rooms/RoomsViewController.m @@ -267,13 +267,12 @@ // Preview the public room if (publicRoom.worldReadable) { - RoomPreviewData *roomPreviewData = [[RoomPreviewData alloc] initWithRoomId:publicRoom.roomId andSession:recentsDataSource.publicRoomsDirectoryDataSource.mxSession]; - + RoomPreviewData *roomPreviewData = [[RoomPreviewData alloc] initWithPublicRoom:publicRoom andSession:recentsDataSource.publicRoomsDirectoryDataSource.mxSession]; + [self startActivityIndicator]; // Try to get more information about the room before opening its preview [roomPreviewData peekInRoom:^(BOOL succeeded) { - [self stopActivityIndicator]; [[AppDelegate theDelegate].masterTabBarController showRoomPreview:roomPreviewData]; From 1886c4cef3cfe20bab1fb8e20a6b8df0ac6c8308 Mon Sep 17 00:00:00 2001 From: manuroe Date: Wed, 1 Apr 2020 17:34:35 +0200 Subject: [PATCH 2/6] Fix crash due to malformed widget --- CHANGES.rst | 3 ++- Riot/Managers/Widgets/WidgetManager.m | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index c2153c78b..81176ef5a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,7 +2,8 @@ Changes in 0.10.5 (TBD) =============================================== Bug fix: -* Fix error when joining some public rooms. (#2888). + * Fix error when joining some public rooms, thanks to @chrismoos (PR #2888). + * Fix crash due to malformed widget (#2997). Changes in 0.10.4 (2019-12-11) =============================================== diff --git a/Riot/Managers/Widgets/WidgetManager.m b/Riot/Managers/Widgets/WidgetManager.m index e7b4704b5..843dec06a 100644 --- a/Riot/Managers/Widgets/WidgetManager.m +++ b/Riot/Managers/Widgets/WidgetManager.m @@ -391,6 +391,11 @@ NSString *const WidgetManagerErrorDomain = @"WidgetManagerErrorDomain"; { // stateKey = widgetId NSString *widgetId = event.stateKey; + if (!widgetId) + { + NSLog(@"[WidgetManager] Error: New widget detected with no id in %@: %@", event.roomId, event.JSONDictionary); + return; + } NSLog(@"[WidgetManager] New widget detected: %@ in %@", widgetId, event.roomId); From 1440a25fffe37a6cbf80ea341343ebde4eb07f62 Mon Sep 17 00:00:00 2001 From: manuroe Date: Wed, 4 Mar 2020 15:10:46 +0100 Subject: [PATCH 3/6] Push notifications: Avoid any automatic deactivation vector-im/riot-ios#3017 --- CHANGES.rst | 1 + Riot/AppDelegate.m | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 81176ef5a..5236c5c98 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,7 @@ Changes in 0.10.5 (TBD) Bug fix: * Fix error when joining some public rooms, thanks to @chrismoos (PR #2888). * Fix crash due to malformed widget (#2997). + * Push notifications: Avoid any automatic deactivation (vector-im/riot-ios#3017). Changes in 0.10.4 (2019-12-11) =============================================== diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index 517395fb0..a126f8f7e 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -2069,9 +2069,13 @@ NSString *const AppDelegateDidValidateEmailNotificationClientSecretKey = @"AppDe { NSLog(@"[AppDelegate][Push] clearPushNotificationToken: Clear existing token"); + // XXX: The following code has been commented to avoid automatic deactivation of push notifications + // There may be a race condition here where the clear happens after the update of the new push token. + // We have no evidence of this. This is a safety measure. + // Clear existing token - MXKAccountManager* accountManager = [MXKAccountManager sharedManager]; - [accountManager setPushDeviceToken:nil withPushOptions:nil]; + //MXKAccountManager* accountManager = [MXKAccountManager sharedManager]; + //[accountManager setPushDeviceToken:nil withPushOptions:nil]; } // Remove delivred notifications for a given room id except call notifications From 72d3d4ef31746c97c8a32df3590ddb7dfd12971a Mon Sep 17 00:00:00 2001 From: Mark Schulte Date: Thu, 19 Mar 2020 08:15:04 -0700 Subject: [PATCH 4/6] AuthFallback: Stay in Riot App When doing a SAML based SSO via Gsuite, I must click a link specifying that I trust this app. That link will break me out of the SSO sign-in process, and open up safari. To fix address this, I've removed the feature that opens links in safari. Signed-off-by: Mark Schulte --- Riot/Modules/Home/Fallback/AuthFallBackViewController.m | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Riot/Modules/Home/Fallback/AuthFallBackViewController.m b/Riot/Modules/Home/Fallback/AuthFallBackViewController.m index b61b6361b..1955779af 100644 --- a/Riot/Modules/Home/Fallback/AuthFallBackViewController.m +++ b/Riot/Modules/Home/Fallback/AuthFallBackViewController.m @@ -203,14 +203,6 @@ NSString *FallBackViewControllerJavascriptOnLogin = @"window.matrixLogin.onLogin return; } - if (navigationAction.navigationType == WKNavigationTypeLinkActivated) - { - // Open links outside the app - [[UIApplication sharedApplication] openURL:navigationAction.request.URL options:@{} completionHandler:nil]; - decisionHandler(WKNavigationActionPolicyCancel); - return; - } - decisionHandler(WKNavigationActionPolicyAllow); } From e17597b0ac10a9e55f1415a31c1fca19c996593c Mon Sep 17 00:00:00 2001 From: Mark Schulte Date: Thu, 19 Mar 2020 08:20:13 -0700 Subject: [PATCH 5/6] Update CHANGES.rst Signed-off-by: Mark Schulte --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.rst b/CHANGES.rst index 5236c5c98..38ab7dad9 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,7 @@ Bug fix: * Fix error when joining some public rooms, thanks to @chrismoos (PR #2888). * Fix crash due to malformed widget (#2997). * Push notifications: Avoid any automatic deactivation (vector-im/riot-ios#3017). + * Fix links breaking user out of SSO flow. Changes in 0.10.4 (2019-12-11) =============================================== From d23ae092ea247064683970b0c489744216b5a085 Mon Sep 17 00:00:00 2001 From: manuroe Date: Wed, 1 Apr 2020 17:51:38 +0200 Subject: [PATCH 6/6] version++ --- CHANGES.rst | 2 +- Podfile | 2 +- Podfile.lock | 16 ++++++++-------- Riot/SupportingFiles/Info.plist | 4 ++-- RiotShareExtension/SupportingFiles/Info.plist | 4 ++-- SiriIntents/Info.plist | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 38ab7dad9..9d1be71c4 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,4 +1,4 @@ -Changes in 0.10.5 (TBD) +Changes in 0.10.5 (2020-04-01) =============================================== Bug fix: diff --git a/Podfile b/Podfile index 08e25c09e..ee2ceb707 100644 --- a/Podfile +++ b/Podfile @@ -7,7 +7,7 @@ use_frameworks! # Different flavours of pods to MatrixKit # The current MatrixKit pod version -$matrixKitVersion = '0.11.3' +$matrixKitVersion = '0.11.4' # The develop branch version #$matrixKitVersion = 'develop' diff --git a/Podfile.lock b/Podfile.lock index bc0650dba..506e78114 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -49,15 +49,15 @@ PODS: - MatomoTracker (7.2.0): - MatomoTracker/Core (= 7.2.0) - MatomoTracker/Core (7.2.0) - - MatrixKit (0.11.3): + - MatrixKit (0.11.4): - cmark (~> 0.24.1) - DTCoreText (~> 1.6.21) - HPGrowingTextView (~> 1.1) - libPhoneNumber-iOS (~> 0.9.13) - - MatrixKit/Core (= 0.11.3) + - MatrixKit/Core (= 0.11.4) - MatrixSDK (= 0.15.2) - SwiftUTI (~> 1.0.6) - - MatrixKit/AppExtension (0.11.3): + - MatrixKit/AppExtension (0.11.4): - cmark (~> 0.24.1) - DTCoreText (~> 1.6.21) - DTCoreText/Extension @@ -65,7 +65,7 @@ PODS: - libPhoneNumber-iOS (~> 0.9.13) - MatrixSDK (= 0.15.2) - SwiftUTI (~> 1.0.6) - - MatrixKit/Core (0.11.3): + - MatrixKit/Core (0.11.4): - cmark (~> 0.24.1) - DTCoreText (~> 1.6.21) - HPGrowingTextView (~> 1.1) @@ -108,8 +108,8 @@ DEPENDENCIES: - DGCollectionViewLeftAlignFlowLayout (~> 1.0.4) - GBDeviceInfo (~> 6.3.0) - MatomoTracker (~> 7.2.0) - - MatrixKit (= 0.11.3) - - MatrixKit/AppExtension (= 0.11.3) + - MatrixKit (= 0.11.4) + - MatrixKit/AppExtension (= 0.11.4) - MatrixSDK/JingleCallStack - MatrixSDK/SwiftSupport - OLMKit @@ -165,7 +165,7 @@ SPEC CHECKSUMS: libbase58: 7c040313537b8c44b6e2d15586af8e21f7354efd libPhoneNumber-iOS: 0a32a9525cf8744fe02c5206eb30d571e38f7d75 MatomoTracker: 6f89e2561083685a360e223fb663e9ccd57c1d1a - MatrixKit: 5a20025b05490a70694b701e607ec75e0988af21 + MatrixKit: 3db15f216e2de4d53b1405434028d44f42d4af22 MatrixSDK: f83bd3c5519c1cb9ac3998f6423574cf528f0250 OLMKit: 4ee0159d63feeb86d836fdcfefe418e163511639 Realm: 5a1d9d47bfc101dd597668b1a8af4288a2557f6d @@ -175,6 +175,6 @@ SPEC CHECKSUMS: SwiftUTI: 917993c124f8eac25e88ced0202fc58d7eb50fa8 zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c -PODFILE CHECKSUM: 881048fb17d68dd834b18e23929482600daca7f3 +PODFILE CHECKSUM: c7b37d248a316ae786328d88148e3155fea6bee3 COCOAPODS: 1.8.4 diff --git a/Riot/SupportingFiles/Info.plist b/Riot/SupportingFiles/Info.plist index d44b69a65..11f3d3859 100644 --- a/Riot/SupportingFiles/Info.plist +++ b/Riot/SupportingFiles/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.10.4 + 0.10.5 CFBundleSignature ???? CFBundleVersion - 0.10.4 + 0.10.5 ITSAppUsesNonExemptEncryption ITSEncryptionExportComplianceCode diff --git a/RiotShareExtension/SupportingFiles/Info.plist b/RiotShareExtension/SupportingFiles/Info.plist index 3306a7f7b..c12a0cd5b 100644 --- a/RiotShareExtension/SupportingFiles/Info.plist +++ b/RiotShareExtension/SupportingFiles/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 0.10.4 + 0.10.5 CFBundleVersion - 0.10.4 + 0.10.5 NSExtension NSExtensionAttributes diff --git a/SiriIntents/Info.plist b/SiriIntents/Info.plist index 6d300ab1a..0df3b8d12 100644 --- a/SiriIntents/Info.plist +++ b/SiriIntents/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 0.10.4 + 0.10.5 CFBundleVersion - 0.10.4 + 0.10.5 NSExtension NSExtensionAttributes