Merge mac-release

This commit is contained in:
Maurice Parker
2023-02-08 16:37:29 -08:00
parent a4d96dc473
commit a39dae0a44
6 changed files with 68 additions and 12 deletions

View File

@@ -326,6 +326,26 @@ public final class AccountManager: UnreadCountProvider {
return false
}
public func anyLocalOriCloudAccountHasAtLeastOneTwitterFeed() -> Bool {
// We removed our Twitter code, and the ability to read feeds from Twitter,
// when Twitter announced the end of the free tier for the Twitter API.
// We are cheering on Twitters increasing irrelevancy.
for account in accounts {
if account.type == .cloudKit || account.type == .onMyMac {
for webfeed in account.flattenedWebFeeds() {
if let components = URLComponents(string: webfeed.url), let host = components.host {
if host == "twitter.com" { // Allow, for instance, blog.twitter.com, which might have an actual RSS feed
return true
}
}
}
}
}
return false
}
// MARK: - Fetching Articles
// These fetch articles from active accounts and return a merged Set<Article>.

View File

@@ -43,6 +43,7 @@ final class AppDefaults {
static let defaultBrowserID = "defaultBrowserID"
static let currentThemeName = "currentThemeName"
static let hasSeenNotAllArticlesHaveURLsAlert = "hasSeenNotAllArticlesHaveURLsAlert"
static let twitterDeprecationAlertShown = "twitterDeprecationAlertShown"
// Hidden prefs
static let showDebugMenu = "ShowDebugMenu"
@@ -318,6 +319,16 @@ final class AppDefaults {
UserDefaults.standard.set(newValue.rawValue, forKey: Key.refreshInterval)
}
}
var twitterDeprecationAlertShown: Bool {
get {
return AppDefaults.bool(for: Key.twitterDeprecationAlertShown)
}
set {
AppDefaults.setBool(for: Key.twitterDeprecationAlertShown, newValue)
}
}
func registerDefaults() {
#if DEBUG

View File

@@ -131,6 +131,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
NSWorkspace.shared.notificationCenter.addObserver(self, selector: #selector(didWakeNotification(_:)), name: NSWorkspace.didWakeNotification, object: nil)
appDelegate = self
presentTwitterDeprecationAlertIfRequired()
}
// MARK: - API
@@ -954,6 +956,33 @@ internal extension AppDelegate {
alert.beginSheetModal(for: window)
}
private func presentTwitterDeprecationAlertIfRequired() {
if AppDefaults.shared.twitterDeprecationAlertShown { return }
let expiryDate = Date(timeIntervalSince1970: 1691539200) // August 9th 2023, 00:00 UTC
let currentDate = Date()
if currentDate > expiryDate {
return // If after August 9th, don't show
}
if AccountManager.shared.anyLocalOriCloudAccountHasAtLeastOneTwitterFeed() {
showTwitterDeprecationAlert()
}
AppDefaults.shared.twitterDeprecationAlertShown = true
}
private func showTwitterDeprecationAlert() {
DispatchQueue.main.async {
let alert = NSAlert()
alert.alertStyle = .warning
alert.messageText = NSLocalizedString("Twitter Integration Removed", comment: "Twitter Integration Removed")
alert.informativeText = NSLocalizedString("On February 1, 2023, Twitter announced the end of free access to the Twitter API, effective February 9.\n\nSince Twitter does not provide RSS feeds, weve had to use the Twitter API. Without free access to that API, we cant read feeds from Twitter.\n\nWeve left your Twitter feeds intact. If you have any starred items from those feeds, they will remain as long as you dont delete those feeds.\n\nYou can still read whatever you have already downloaded. However, those feeds will no longer update.", comment: "Twitter deprecation informative text.")
alert.addButton(withTitle: NSLocalizedString("OK", comment: "OK"))
alert.buttons[0].keyEquivalent = "\r"
alert.runModal()
}
}
}
/*

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
version = "1.7">
version = "1.8">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
@@ -45,15 +45,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "849C645F1ED37A5D003D8FC0"
BuildableName = "NetNewsWire.app"
BlueprintName = "NetNewsWire"
ReferencedContainer = "container:NetNewsWire.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
</Testables>
</TestAction>

View File

@@ -1,5 +1,10 @@
# Mac Release Notes
### 6.1.1b2 build 6108 5 Feb 2023
Remove Twitter integration. On first launch, for people with Twitter feeds, display an alert explaining what happened
Fix a crashing bug that could happen in the sidebar
### 6.1.1b1 build 6107 3 Nov 2022
Fixed a bug that could prevent users from accessing BazQux if an article was missing a field

View File

@@ -1,6 +1,6 @@
// High Level Settings common to both the Mac application and any extensions we bundle with it
MARKETING_VERSION = 6.1.1
CURRENT_PROJECT_VERSION = 6107
MARKETING_VERSION = 6.1.1b2
CURRENT_PROJECT_VERSION = 6108
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;