From 2b11d4d325c75c6b4e9f55f5b6186d49f0837587 Mon Sep 17 00:00:00 2001 From: Doug Date: Mon, 13 Sep 2021 16:49:34 +0100 Subject: [PATCH 1/6] Ensure the last bubble component has a link before loading the URL preview. --- Riot/Modules/Room/CellData/RoomBubbleCellData.m | 2 +- changelog.d/4823.bugfix | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/4823.bugfix diff --git a/Riot/Modules/Room/CellData/RoomBubbleCellData.m b/Riot/Modules/Room/CellData/RoomBubbleCellData.m index 33a34821f2..584fca7ae2 100644 --- a/Riot/Modules/Room/CellData/RoomBubbleCellData.m +++ b/Riot/Modules/Room/CellData/RoomBubbleCellData.m @@ -1076,7 +1076,7 @@ - (void)loadURLPreview { // Get the last bubble component as that contains the link. MXKRoomBubbleComponent *lastComponent = bubbleComponents.lastObject; - if (!lastComponent) + if (!lastComponent || !lastComponent.link) { return; } diff --git a/changelog.d/4823.bugfix b/changelog.d/4823.bugfix new file mode 100644 index 0000000000..87c9df647e --- /dev/null +++ b/changelog.d/4823.bugfix @@ -0,0 +1 @@ +RoomBubbleCellData: Fix crash when creating a URL preview when the link didn't end up in the last bubble component. \ No newline at end of file From 721e5daa23185340172d6f0e57ba947ba6ad74dc Mon Sep 17 00:00:00 2001 From: Doug Date: Mon, 13 Sep 2021 17:47:52 +0100 Subject: [PATCH 2/6] Override hasLink in RoomBubbleCellData to only check the last component. --- Riot/Modules/Room/CellData/RoomBubbleCellData.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Riot/Modules/Room/CellData/RoomBubbleCellData.m b/Riot/Modules/Room/CellData/RoomBubbleCellData.m index 584fca7ae2..e8c8dcdc30 100644 --- a/Riot/Modules/Room/CellData/RoomBubbleCellData.m +++ b/Riot/Modules/Room/CellData/RoomBubbleCellData.m @@ -254,6 +254,14 @@ - (NSAttributedString*)attributedTextMessage return attributedTextMessage; } +- (BOOL)hasLink +{ + // Only check the last bubble component as -addEvent:andRoomState: will break up + // the data that way, to always show a URL preview at the bottom of the cell. + MXKRoomBubbleComponent *lastComponent = bubbleComponents.lastObject; + return (lastComponent && lastComponent.link); +} + - (BOOL)hasNoDisplay { if (self.tag == RoomBubbleCellDataTagKeyVerificationNoDisplay) From 7a735f87148319dd9ab79b1ac20c10804628dc31 Mon Sep 17 00:00:00 2001 From: manuroe Date: Thu, 16 Sep 2021 13:49:43 +0200 Subject: [PATCH 3/6] changelog.d: Upgrade MatrixKit version ([v0.16.1](https://github.com/matrix-org/matrix-ios-kit/releases/tag/v0.16.1)). --- 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 30e41cd1e7..83a640d2f8 100644 --- a/Config/AppVersion.xcconfig +++ b/Config/AppVersion.xcconfig @@ -15,5 +15,5 @@ // // Version -MARKETING_VERSION = 1.5.3 -CURRENT_PROJECT_VERSION = 1.5.3 +MARKETING_VERSION = 1.5.4 +CURRENT_PROJECT_VERSION = 1.5.4 diff --git a/Podfile b/Podfile index 39477f80a6..1dd3fcb742 100644 --- a/Podfile +++ b/Podfile @@ -13,7 +13,7 @@ use_frameworks! # - `{ {kit spec hash} => {sdk spec hash}` to depend on specific pod options (:git => …, :podspec => …) for each 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 -$matrixKitVersion = '= 0.16.0' +$matrixKitVersion = '= 0.16.1' # $matrixKitVersion = :local # $matrixKitVersion = {'develop' => 'develop'} diff --git a/changelog.d/x-nolink-0.change b/changelog.d/x-nolink-0.change new file mode 100644 index 0000000000..512aec818e --- /dev/null +++ b/changelog.d/x-nolink-0.change @@ -0,0 +1 @@ +Upgrade MatrixKit version ([v0.16.1](https://github.com/matrix-org/matrix-ios-kit/releases/tag/v0.16.1)). \ No newline at end of file From 2924ada91cdbbc19c48053a8ddf0ad8c51828182 Mon Sep 17 00:00:00 2001 From: manuroe Date: Thu, 16 Sep 2021 13:49:44 +0200 Subject: [PATCH 4/6] version++ --- CHANGES.md | 11 +++++++++++ changelog.d/4823.bugfix | 1 - changelog.d/x-nolink-0.change | 1 - 3 files changed, 11 insertions(+), 2 deletions(-) delete mode 100644 changelog.d/4823.bugfix delete mode 100644 changelog.d/x-nolink-0.change diff --git a/CHANGES.md b/CHANGES.md index 3a2b38438d..8acd9fe4a9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,14 @@ +## Changes in 1.5.4 (2021-09-16) + +🙌 Improvements + +- Upgrade MatrixKit version ([v0.16.1](https://github.com/matrix-org/matrix-ios-kit/releases/tag/v0.16.1)). + +🐛 Bugfixes + +- RoomBubbleCellData: Fix crash when creating a URL preview when the link didn't end up in the last bubble component. ([#4823](https://github.com/vector-im/element-ios/issues/4823)) + + ## Changes in 1.5.3 (2021-09-09) ✨ Features diff --git a/changelog.d/4823.bugfix b/changelog.d/4823.bugfix deleted file mode 100644 index 87c9df647e..0000000000 --- a/changelog.d/4823.bugfix +++ /dev/null @@ -1 +0,0 @@ -RoomBubbleCellData: Fix crash when creating a URL preview when the link didn't end up in the last bubble component. \ No newline at end of file diff --git a/changelog.d/x-nolink-0.change b/changelog.d/x-nolink-0.change deleted file mode 100644 index 512aec818e..0000000000 --- a/changelog.d/x-nolink-0.change +++ /dev/null @@ -1 +0,0 @@ -Upgrade MatrixKit version ([v0.16.1](https://github.com/matrix-org/matrix-ios-kit/releases/tag/v0.16.1)). \ No newline at end of file From 56711bf5e359c24602d252d699f112d5d34369c4 Mon Sep 17 00:00:00 2001 From: manuroe Date: Thu, 16 Sep 2021 14:24:20 +0200 Subject: [PATCH 5/6] Fastlane: Make point_dependencies_to_pending_releases default to master if there is no pending release branch. This is not great. The build cannot be reproducible but it is better than using develop --- fastlane/Fastfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 1637c458db..be009186e7 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -108,9 +108,9 @@ platform :ios do end end - desc "Point MatrixKit and MatrixSDK to their respective release/*/release branch if they exist, develop otherwise" + desc "Point MatrixKit and MatrixSDK to their respective release/*/release branch if they exist, master otherwise" lane :point_dependencies_to_pending_releases do - edit_podfile(branch_pattern: "release/*/release") + edit_podfile(branch_pattern: "release/*/release", default_branch: "master") end desc "Point MatrixKit and MatrixSDK to the branch with the same name as the current branch if such one exist, develop otherwise" @@ -391,8 +391,9 @@ platform :ios do kit_slug = "matrix-org/matrix-ios-kit" sdk_slug = "matrix-org/matrix-ios-sdk" - kit_branch = find_branch(kit_slug, branch_pattern) || 'develop' - sdk_branch = find_branch(sdk_slug, branch_pattern) || 'develop' + default_branch = options[:default_branch] || 'develop' + kit_branch = find_branch(kit_slug, branch_pattern) || default_branch + sdk_branch = find_branch(sdk_slug, branch_pattern) || default_branch kit_spec = { git: 'https://github.com/matrix-org/matrix-ios-kit.git', branch: kit_branch } kit_podspec = { podspec: 'MatrixKit.edited.podspec' } From b3c4f6b45b7646ed6b1f31b0b3ce73181e083964 Mon Sep 17 00:00:00 2001 From: manuroe Date: Thu, 16 Sep 2021 14:59:17 +0200 Subject: [PATCH 6/6] finish version++ --- Podfile.lock | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Podfile.lock b/Podfile.lock index 34d60ca43b..fd653d0171 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -58,29 +58,29 @@ PODS: - MatomoTracker (7.4.1): - MatomoTracker/Core (= 7.4.1) - MatomoTracker/Core (7.4.1) - - MatrixKit (0.16.0): + - MatrixKit (0.16.1): - Down (~> 0.11.0) - DTCoreText (~> 1.6.25) - HPGrowingTextView (~> 1.1) - libPhoneNumber-iOS (~> 0.9.13) - - MatrixKit/Core (= 0.16.0) - - MatrixSDK (= 0.20.0) - - MatrixKit/Core (0.16.0): + - MatrixKit/Core (= 0.16.1) + - MatrixSDK (= 0.20.1) + - MatrixKit/Core (0.16.1): - Down (~> 0.11.0) - DTCoreText (~> 1.6.25) - HPGrowingTextView (~> 1.1) - libPhoneNumber-iOS (~> 0.9.13) - - MatrixSDK (= 0.20.0) - - MatrixSDK (0.20.0): - - MatrixSDK/Core (= 0.20.0) - - MatrixSDK/Core (0.20.0): + - MatrixSDK (= 0.20.1) + - MatrixSDK (0.20.1): + - MatrixSDK/Core (= 0.20.1) + - MatrixSDK/Core (0.20.1): - AFNetworking (~> 4.0.0) - GZIP (~> 1.3.0) - libbase58 (~> 0.1.4) - OLMKit (~> 3.2.4) - Realm (= 10.7.6) - SwiftyBeaver (= 1.9.5) - - MatrixSDK/JingleCallStack (0.20.0): + - MatrixSDK/JingleCallStack (0.20.1): - JitsiMeetSDK (= 3.5.0) - MatrixSDK/Core - OLMKit (3.2.4): @@ -124,7 +124,7 @@ DEPENDENCIES: - KeychainAccess (~> 4.2.2) - KTCenterFlowLayout (~> 1.3.1) - MatomoTracker (~> 7.4.1) - - MatrixKit (= 0.16.0) + - MatrixKit (= 0.16.1) - MatrixSDK - MatrixSDK/JingleCallStack - OLMKit @@ -204,8 +204,8 @@ SPEC CHECKSUMS: LoggerAPI: ad9c4a6f1e32f518fdb43a1347ac14d765ab5e3d Logging: beeb016c9c80cf77042d62e83495816847ef108b MatomoTracker: 24a846c9d3aa76933183fe9d47fd62c9efa863fb - MatrixKit: ee31a0ef0304c1c4ff4477f977772efed44f2b49 - MatrixSDK: 07bbc083632799e9ef7f3b14139cb1ab72f1610e + MatrixKit: 7033539085bc94b6b8755fdab68ba6f7e6e79d56 + MatrixSDK: 37fbb6a650095387e908937b7411c4370599c90b OLMKit: 2d73cd67d149b5c3e3a8eb8ecae93d0b429d8a02 ReadMoreTextView: 19147adf93abce6d7271e14031a00303fe28720d Realm: ed860452717c8db8f4bf832b6807f7f2ce708839 @@ -219,6 +219,6 @@ SPEC CHECKSUMS: zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb -PODFILE CHECKSUM: 1f5ce3d0f93688632aaf046398de5a2c6347ffc4 +PODFILE CHECKSUM: 1a36889466e39ecec11851d9aa0baa82f4500581 COCOAPODS: 1.10.1