From fe6fbd31a8b3b2b9029eee1fb67f7708377edf2c Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sat, 8 Feb 2020 16:14:45 -0800 Subject: [PATCH 1/4] Edit the about NetNewsWire text. Add credit for Wevah; add thanks to Feedbin for Reader view hosting. --- iOS/Resources/About.rtf | 2 +- iOS/Resources/Credits.rtf | 1 + iOS/Resources/Thanks.rtf | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iOS/Resources/About.rtf b/iOS/Resources/About.rtf index 9f2ae4571..41b356e05 100644 --- a/iOS/Resources/About.rtf +++ b/iOS/Resources/About.rtf @@ -5,7 +5,7 @@ \margl1440\margr1440\vieww8340\viewh9300\viewkind0 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li363\fi-364\pardirnatural\partightenfactor0 -\f0\b\fs28 \cf2 By Brent Simmons and the NetNewsWire team +\f0\b\fs28 \cf2 By Brent Simmons and the Ranchero Software team \fs22 \ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0 {\field{\*\fldinst{HYPERLINK "https://ranchero.com/netnewswire/"}}{\fldrslt diff --git a/iOS/Resources/Credits.rtf b/iOS/Resources/Credits.rtf index 10327f37d..a4c868701 100644 --- a/iOS/Resources/Credits.rtf +++ b/iOS/Resources/Credits.rtf @@ -11,6 +11,7 @@ Lead iOS developer: {\field{\*\fldinst{HYPERLINK "https://github.com/vincode-io" App icon: {\field{\*\fldinst{HYPERLINK "https://twitter.com/BradEllis"}}{\fldrslt Brad Ellis}}\ \pard\pardeftab720\li366\fi-367\sa60\partightenfactor0 \cf2 Feedly syncing: {\field{\*\fldinst{HYPERLINK "https://twitter.com/kielgillard"}}{\fldrslt Kiel Gillard}}\ +Under-the-hood magic and CSS stylin\'92s: {\field{\*\fldinst{HYPERLINK "https://github.com/wevah"}}{\fldrslt Nate Weaver}}\ \pard\pardeftab720\li362\fi-363\sa60\partightenfactor0 \cf2 Newsfoot (JS footnote displayer): {\field{\*\fldinst{HYPERLINK "https://github.com/brehaut/"}}{\fldrslt Andrew Brehaut}}\ \pard\pardeftab720\li355\fi-356\sa60\partightenfactor0 diff --git a/iOS/Resources/Thanks.rtf b/iOS/Resources/Thanks.rtf index 85592b61a..a79881b62 100644 --- a/iOS/Resources/Thanks.rtf +++ b/iOS/Resources/Thanks.rtf @@ -8,4 +8,4 @@ \f0\fs22 \cf2 Thanks to Sheila and my family; thanks to my friends in Seattle and around the globe; thanks to my co-workers and friends at {\field{\*\fldinst{HYPERLINK "https://www.omnigroup.com"}}{\fldrslt the Omni Group}}; thanks to the ever-patient and ever-awesome NetNewsWire beta testers. \ \pard\tx0\pardeftab720\li360\fi-361\sa60\partightenfactor0 -\cf2 Thanks to {\field{\*\fldinst{HYPERLINK "https://shapeof.com/"}}{\fldrslt Gus Mueller}} for {\field{\*\fldinst{HYPERLINK "https://github.com/ccgus/fmdb"}}{\fldrslt FMDB}} by {\field{\*\fldinst{HYPERLINK "http://flyingmeat.com/"}}{\fldrslt Flying Meat Software}}. Thanks to {\field{\*\fldinst{HYPERLINK "https://github.com"}}{\fldrslt GitHub}} and {\field{\*\fldinst{HYPERLINK "https://slack.com"}}{\fldrslt Slack}} for making open source collaboration easy and fun. Thanks to {\field{\*\fldinst{HYPERLINK "https://benubois.com/"}}{\fldrslt Ben Ubois}} at {\field{\*\fldinst{HYPERLINK "https://feedbin.com/"}}{\fldrslt Feedbin}} for all the extra help with syncing and article rendering.} \ No newline at end of file +\cf2 Thanks to {\field{\*\fldinst{HYPERLINK "https://shapeof.com/"}}{\fldrslt Gus Mueller}} for {\field{\*\fldinst{HYPERLINK "https://github.com/ccgus/fmdb"}}{\fldrslt FMDB}} by {\field{\*\fldinst{HYPERLINK "http://flyingmeat.com/"}}{\fldrslt Flying Meat Software}}. Thanks to {\field{\*\fldinst{HYPERLINK "https://github.com"}}{\fldrslt GitHub}} and {\field{\*\fldinst{HYPERLINK "https://slack.com"}}{\fldrslt Slack}} for making open source collaboration easy and fun. Thanks to {\field{\*\fldinst{HYPERLINK "https://benubois.com/"}}{\fldrslt Ben Ubois}} at {\field{\*\fldinst{HYPERLINK "https://feedbin.com/"}}{\fldrslt Feedbin}} for all the extra help with syncing and article rendering \'97\'a0and for {\field{\*\fldinst{HYPERLINK "https://feedbin.com/blog/2019/03/11/the-future-of-full-content/"}}{\fldrslt hosting the server for the Reader view}}.} \ No newline at end of file From 4ac8107f27b52ed65c3230a65d6dbdf91b227d8f Mon Sep 17 00:00:00 2001 From: Nate Weaver Date: Sat, 8 Feb 2020 17:43:16 -0600 Subject: [PATCH 2/4] Don't unwrap now-non-optionals, and unwrap now-explicit optionals --- Frameworks/Account/FeedFinder/HTMLFeedFinder.swift | 6 ++---- Shared/Images/RSHTMLMetadata+Extension.swift | 7 +++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Frameworks/Account/FeedFinder/HTMLFeedFinder.swift b/Frameworks/Account/FeedFinder/HTMLFeedFinder.swift index e8f242a56..39c3a095b 100644 --- a/Frameworks/Account/FeedFinder/HTMLFeedFinder.swift +++ b/Frameworks/Account/FeedFinder/HTMLFeedFinder.swift @@ -29,16 +29,14 @@ class HTMLFeedFinder { } } - if let bodyLinks = RSHTMLLinkParser.htmlLinks(with: parserData) { + let bodyLinks = RSHTMLLinkParser.htmlLinks(with: parserData) for oneBodyLink in bodyLinks { - if linkMightBeFeed(oneBodyLink) { - let normalizedURL = oneBodyLink.urlString.normalizedURL + if linkMightBeFeed(oneBodyLink), let normalizedURL = oneBodyLink.urlString?.normalizedURL { let oneFeedSpecifier = FeedSpecifier(title: oneBodyLink.text, urlString: normalizedURL, source: .HTMLLink) addFeedSpecifier(oneFeedSpecifier) } } - } } } diff --git a/Shared/Images/RSHTMLMetadata+Extension.swift b/Shared/Images/RSHTMLMetadata+Extension.swift index cf5dd8ba7..82580ab37 100644 --- a/Shared/Images/RSHTMLMetadata+Extension.swift +++ b/Shared/Images/RSHTMLMetadata+Extension.swift @@ -12,8 +12,9 @@ import RSParser extension RSHTMLMetadata { func largestOpenGraphImageURL() -> String? { + let openGraphImages = openGraphProperties.images - guard let openGraphImages = openGraphProperties?.images, !openGraphImages.isEmpty else { + guard !openGraphImages.isEmpty else { return nil } @@ -47,7 +48,9 @@ extension RSHTMLMetadata { func largestAppleTouchIcon() -> String? { - guard let icons = appleTouchIcons, !icons.isEmpty else { + let icons = appleTouchIcons + + guard !icons.isEmpty else { return nil } From 2ac4df4ee6fe974255e30fde9cbc0dba770ed900 Mon Sep 17 00:00:00 2001 From: Nate Weaver Date: Sat, 8 Feb 2020 17:46:48 -0600 Subject: [PATCH 3/4] Use a single compactMap() instead of filter().compactMap() --- Shared/Favicons/FaviconURLFinder.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Shared/Favicons/FaviconURLFinder.swift b/Shared/Favicons/FaviconURLFinder.swift index 54f38606b..cc429e4c6 100644 --- a/Shared/Favicons/FaviconURLFinder.swift +++ b/Shared/Favicons/FaviconURLFinder.swift @@ -49,20 +49,20 @@ struct FaviconURLFinder { // If the favicon has an explicit type, check that for an ignored type; otherwise, check the file extension. HTMLMetadataDownloader.downloadMetadata(for: homePageURL) { (htmlMetadata) in - let faviconURLs = htmlMetadata?.favicons.filter({ (favicon) -> Bool in + let faviconURLs = htmlMetadata?.favicons.compactMap({ (favicon) -> String? in if let type = favicon.type { if ignoredMimeTypes.contains(type) { - return false + return nil } } else { if let urlString = favicon.urlString, let url = URL(string: urlString), ignoredExtensions.contains(url.pathExtension) { - return false + return nil } } - return true - }).compactMap { $0.urlString } + return favicon.urlString + }) completion(faviconURLs) } From 4e0ad155ce665d85fc42e982027dee48f3805dff Mon Sep 17 00:00:00 2001 From: Nate Weaver Date: Sat, 8 Feb 2020 18:22:19 -0600 Subject: [PATCH 4/4] Update RSParser --- submodules/RSParser | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/RSParser b/submodules/RSParser index 840877988..47ba87875 160000 --- a/submodules/RSParser +++ b/submodules/RSParser @@ -1 +1 @@ -Subproject commit 840877988917cf3dbc56b8a0c6e33ddd7aa66479 +Subproject commit 47ba87875fbd026dccc2c4d4382a98cb4a1f1fbc