diff --git a/Mac/MainWindow/AddFeed/AddFeedController.swift b/Mac/MainWindow/AddFeed/AddFeedController.swift index ad5dd8984..7de1d2b76 100644 --- a/Mac/MainWindow/AddFeed/AddFeedController.swift +++ b/Mac/MainWindow/AddFeed/AddFeedController.swift @@ -73,7 +73,7 @@ final class AddFeedController: AddFeedWindowControllerDelegate { switch result { case .success(let feed): - NotificationCenter.default.post(name: .UserDidAddFeed, object: self, userInfo: [UserInfoKey.webFeed: feed]) + NotificationCenter.default.post(name: .UserDidAddFeed, object: self, userInfo: [UserInfoKey.feed: feed]) case .failure(let error): switch error { case AccountError.createErrorAlreadySubscribed: diff --git a/Mac/MainWindow/Detail/DetailWebViewController.swift b/Mac/MainWindow/Detail/DetailWebViewController.swift index af3d5bd81..f314f5172 100644 --- a/Mac/MainWindow/Detail/DetailWebViewController.swift +++ b/Mac/MainWindow/Detail/DetailWebViewController.swift @@ -108,7 +108,7 @@ final class DetailWebViewController: NSViewController { webInspectorEnabled = AppDefaults.shared.webInspectorEnabled NotificationCenter.default.addObserver(self, selector: #selector(webInspectorEnabledDidChange(_:)), name: .WebInspectorEnabledDidChange, object: nil) - NotificationCenter.default.addObserver(self, selector: #selector(webFeedIconDidBecomeAvailable(_:)), name: .feedIconDidBecomeAvailable, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(feedIconDidBecomeAvailable(_:)), name: .feedIconDidBecomeAvailable, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(avatarDidBecomeAvailable(_:)), name: .AvatarDidBecomeAvailable, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(faviconDidBecomeAvailable(_:)), name: .FaviconDidBecomeAvailable, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(userDefaultsDidChange(_:)), name: UserDefaults.didChangeNotification, object: nil) @@ -119,7 +119,7 @@ final class DetailWebViewController: NSViewController { // MARK: Notifications - @objc func webFeedIconDidBecomeAvailable(_ note: Notification) { + @objc func feedIconDidBecomeAvailable(_ note: Notification) { reloadArticleImage() } diff --git a/Mac/MainWindow/MainWindowController.swift b/Mac/MainWindow/MainWindowController.swift index d666f827b..4b7ef0213 100644 --- a/Mac/MainWindow/MainWindowController.swift +++ b/Mac/MainWindow/MainWindowController.swift @@ -1384,10 +1384,10 @@ private extension MainWindowController { func buildNewSidebarItemMenu() -> NSMenu { let menu = NSMenu() - let newWebFeedItem = NSMenuItem() - newWebFeedItem.title = NSLocalizedString("New Feed…", comment: "New Feed") - newWebFeedItem.action = Selector(("showAddWebFeedWindow:")) - menu.addItem(newWebFeedItem) + let newFeedItem = NSMenuItem() + newFeedItem.title = NSLocalizedString("New Feed…", comment: "New Feed") + newFeedItem.action = Selector(("showAddWebFeedWindow:")) + menu.addItem(newFeedItem) let newFolderFeedItem = NSMenuItem() newFolderFeedItem.title = NSLocalizedString("New Folder…", comment: "New Folder") diff --git a/Mac/MainWindow/Sidebar/SidebarOutlineDataSource.swift b/Mac/MainWindow/Sidebar/SidebarOutlineDataSource.swift index 3428ab11c..f4de707ae 100644 --- a/Mac/MainWindow/Sidebar/SidebarOutlineDataSource.swift +++ b/Mac/MainWindow/Sidebar/SidebarOutlineDataSource.swift @@ -47,8 +47,8 @@ import Account return nil } - // WebFeed objects don't have knowledge of their parent so we inject parent container information - // into WebFeedPasteboardWriter instance and it adds this field to the PasteboardWebFeed objects it writes. + // Feed objects don't have knowledge of their parent so we inject parent container information + // into FeedPasteboardWriter instance and it adds this field to the PasteboardFeed objects it writes. // Add similar to FolderPasteboardWriter if/when we allow sub-folders if let feedWriter = pasteboardWriter as? FeedPasteboardWriter { if let parentContainerID = (node.parent?.representedObject as? Folder)?.containerID { @@ -315,7 +315,7 @@ private extension SidebarOutlineDataSource { return .copy // different AccountIDs means can only copy } - func copyWebFeedInAccount(_ feed: Feed, _ destination: Container ) { + func copyFeedInAccount(_ feed: Feed, _ destination: Container ) { destination.account?.addFeed(feed, to: destination) { result in switch result { case .success: @@ -326,7 +326,7 @@ private extension SidebarOutlineDataSource { } } - func moveWebFeedInAccount(_ feed: Feed, _ source: Container, _ destination: Container) { + func moveFeedInAccount(_ feed: Feed, _ source: Container, _ destination: Container) { BatchUpdate.shared.start() source.account?.moveFeed(feed, from: source, to: destination) { result in BatchUpdate.shared.end() @@ -339,12 +339,12 @@ private extension SidebarOutlineDataSource { } } - func copyWebFeedBetweenAccounts(_ feed: Feed, _ destinationContainer: Container) { + func copyFeedBetweenAccounts(_ feed: Feed, _ destinationContainer: Container) { guard let destinationAccount = destinationContainer.account else { return } - if let existingFeed = destinationAccount.existingWebFeed(withURL: feed.url) { + if let existingFeed = destinationAccount.existingFeed(withURL: feed.url) { destinationAccount.addFeed(existingFeed, to: destinationContainer) { result in switch result { case .success: @@ -373,8 +373,8 @@ private extension SidebarOutlineDataSource { draggedFeeds.forEach { pasteboardFeed in guard let sourceAccountID = pasteboardFeed.accountID, let sourceAccount = AccountManager.shared.existingAccount(with: sourceAccountID), - let webFeedID = pasteboardFeed.feedID, - let feed = sourceAccount.existingWebFeed(withWebFeedID: webFeedID), + let feedID = pasteboardFeed.feedID, + let feed = sourceAccount.existingFeed(withFeedID: feedID), let destinationContainer = parentNode.representedObject as? Container else { return @@ -391,12 +391,12 @@ private extension SidebarOutlineDataSource { if sameAccount(pasteboardFeed, parentNode) { if NSApplication.shared.currentEvent?.modifierFlags.contains(.option) ?? false { - copyWebFeedInAccount(feed, destinationContainer) + copyFeedInAccount(feed, destinationContainer) } else { - moveWebFeedInAccount(feed, sourceContainer, destinationContainer) + moveFeedInAccount(feed, sourceContainer, destinationContainer) } } else { - copyWebFeedBetweenAccounts(feed, destinationContainer) + copyFeedBetweenAccounts(feed, destinationContainer) } } @@ -444,7 +444,7 @@ private extension SidebarOutlineDataSource { switch result { case .success(let destinationFolder): for feed in folder.topLevelFeeds { - if let existingFeed = destinationAccount.existingWebFeed(withURL: feed.url) { + if let existingFeed = destinationAccount.existingFeed(withURL: feed.url) { destinationAccount.addFeed(existingFeed, to: destinationFolder) { result in switch result { case .success: diff --git a/Mac/MainWindow/Sidebar/SidebarViewController.swift b/Mac/MainWindow/Sidebar/SidebarViewController.swift index 21506f883..c0375fc5d 100644 --- a/Mac/MainWindow/Sidebar/SidebarViewController.swift +++ b/Mac/MainWindow/Sidebar/SidebarViewController.swift @@ -83,7 +83,7 @@ protocol SidebarDelegate: AnyObject { NotificationCenter.default.addObserver(self, selector: #selector(userDidAddFeed(_:)), name: .UserDidAddFeed, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(batchUpdateDidPerform(_:)), name: .BatchUpdateDidPerform, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(faviconDidBecomeAvailable(_:)), name: .FaviconDidBecomeAvailable, object: nil) - NotificationCenter.default.addObserver(self, selector: #selector(webFeedIconDidBecomeAvailable(_:)), name: .feedIconDidBecomeAvailable, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(feedIconDidBecomeAvailable(_:)), name: .feedIconDidBecomeAvailable, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(webFeedSettingDidChange(_:)), name: .WebFeedSettingDidChange, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(displayNameDidChange(_:)), name: .DisplayNameDidChange, object: nil) DistributedNotificationCenter.default().addObserver(self, selector: #selector(appleSideBarDefaultIconSizeChanged(_:)), name: .appleSideBarDefaultIconSizeChanged, object: nil) @@ -216,7 +216,7 @@ protocol SidebarDelegate: AnyObject { } @objc func userDidAddFeed(_ notification: Notification) { - guard let feed = notification.userInfo?[UserInfoKey.webFeed] else { + guard let feed = notification.userInfo?[UserInfoKey.feed] else { return } revealAndSelectRepresentedObject(feed as AnyObject) @@ -226,9 +226,9 @@ protocol SidebarDelegate: AnyObject { applyToAvailableCells(configureFavicon) } - @objc func webFeedIconDidBecomeAvailable(_ note: Notification) { - guard let webFeed = note.userInfo?[UserInfoKey.webFeed] as? Feed else { return } - configureCellsForRepresentedObject(webFeed) + @objc func feedIconDidBecomeAvailable(_ note: Notification) { + guard let feed = note.userInfo?[UserInfoKey.feed] as? Feed else { return } + configureCellsForRepresentedObject(feed) } @objc func webFeedSettingDidChange(_ note: Notification) { @@ -577,10 +577,10 @@ private extension SidebarViewController { if folderFeed.account?.existingFolder(withID: folderFeed.folderID) != nil { treeControllerDelegate.addFilterException(sidebarItemID) } - } else if let webFeed = sidebarItem as? Feed { - if webFeed.account?.existingWebFeed(withWebFeedID: webFeed.webFeedID) != nil { + } else if let feed = sidebarItem as? Feed { + if feed.account?.existingFeed(withFeedID: feed.webFeedID) != nil { treeControllerDelegate.addFilterException(sidebarItemID) - addParentFolderToFilterExceptions(webFeed) + addParentFolderToFilterExceptions(feed) } } } @@ -775,7 +775,7 @@ private extension SidebarViewController { } func findFeedNode(_ userInfo: [AnyHashable : Any]?, beginningAt startingNode: Node) -> Node? { - guard let webFeedID = userInfo?[ArticlePathKey.webFeedID] as? String else { + guard let webFeedID = userInfo?[ArticlePathKey.feedID] as? String else { return nil } if let node = startingNode.descendantNode(where: { ($0.representedObject as? Feed)?.webFeedID == webFeedID }) { diff --git a/Mac/MainWindow/Timeline/TimelineViewController.swift b/Mac/MainWindow/Timeline/TimelineViewController.swift index 6480d50ab..2a55f710f 100644 --- a/Mac/MainWindow/Timeline/TimelineViewController.swift +++ b/Mac/MainWindow/Timeline/TimelineViewController.swift @@ -232,7 +232,7 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr if !didRegisterForNotifications { NotificationCenter.default.addObserver(self, selector: #selector(statusesDidChange(_:)), name: .StatusesDidChange, object: nil) - NotificationCenter.default.addObserver(self, selector: #selector(webFeedIconDidBecomeAvailable(_:)), name: .feedIconDidBecomeAvailable, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(feedIconDidBecomeAvailable(_:)), name: .feedIconDidBecomeAvailable, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(avatarDidBecomeAvailable(_:)), name: .AvatarDidBecomeAvailable, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(faviconDidBecomeAvailable(_:)), name: .FaviconDidBecomeAvailable, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(accountDidDownloadArticles(_:)), name: .AccountDidDownloadArticles, object: nil) @@ -628,8 +628,8 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr updateUnreadCount() } - @objc func webFeedIconDidBecomeAvailable(_ note: Notification) { - guard showIcons, let feed = note.userInfo?[UserInfoKey.webFeed] as? Feed else { + @objc func feedIconDidBecomeAvailable(_ note: Notification) { + guard showIcons, let feed = note.userInfo?[UserInfoKey.feed] as? Feed else { return } let indexesToReload = tableView.indexesOfAvailableRowsPassingTest { (row) -> Bool in @@ -762,7 +762,7 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr let prototypeID = "prototype" let status = ArticleStatus(articleID: prototypeID, read: false, starred: false, dateArrived: Date()) let prototypeArticle = Article(accountID: prototypeID, articleID: prototypeID, feedID: prototypeID, uniqueID: prototypeID, title: longTitle, contentHTML: nil, contentText: nil, markdown: nil, url: nil, externalURL: nil, summary: nil, imageURL: nil, datePublished: nil, dateModified: nil, authors: nil, status: status) - + let prototypeCellData = TimelineCellData(article: prototypeArticle, showFeedName: .feed, feedName: "Prototype Feed Name", byline: nil, iconImage: nil, showIcon: false) let height = TimelineCellLayout.height(for: 100, cellData: prototypeCellData, appearance: cellAppearance) return height diff --git a/Mac/Scriptability/Account+Scriptability.swift b/Mac/Scriptability/Account+Scriptability.swift index 05c6fe59d..327a7e08a 100644 --- a/Mac/Scriptability/Account+Scriptability.swift +++ b/Mac/Scriptability/Account+Scriptability.swift @@ -113,7 +113,7 @@ final class ScriptableAccount: NSObject, UniqueIdScriptingObject, ScriptingObjec @objc(valueInWebFeedsWithUniqueID:) func valueInWebFeeds(withUniqueID id:String) -> ScriptableWebFeed? { - guard let feed = account.existingWebFeed(withWebFeedID: id) else { return nil } + guard let feed = account.existingFeed(withFeedID: id) else { return nil } return ScriptableWebFeed(feed, container:self) } @@ -178,7 +178,7 @@ final class ScriptableAccount: NSObject, UniqueIdScriptingObject, ScriptingObjec @objc(valueInAllWebFeedsWithUniqueID:) func valueInAllWebFeeds(withUniqueID id:String) -> ScriptableWebFeed? { - guard let feed = account.existingWebFeed(withWebFeedID: id) else { return nil } + guard let feed = account.existingFeed(withFeedID: id) else { return nil } return ScriptableWebFeed(feed, container:self) } diff --git a/Mac/Scriptability/WebFeed+Scriptability.swift b/Mac/Scriptability/WebFeed+Scriptability.swift index 706d9be5b..348eb03a5 100644 --- a/Mac/Scriptability/WebFeed+Scriptability.swift +++ b/Mac/Scriptability/WebFeed+Scriptability.swift @@ -106,7 +106,7 @@ final class ScriptableWebFeed: NSObject, UniqueIdScriptingObject, ScriptingObjec let (account, folder) = command.accountAndFolderForNewChild() guard let url = self.urlForNewFeed(arguments:arguments) else {return nil} - if let existingFeed = account.existingWebFeed(withURL:url) { + if let existingFeed = account.existingFeed(withURL:url) { return scriptableFeed(existingFeed, account:account, folder:folder).objectSpecifier } @@ -123,7 +123,7 @@ final class ScriptableWebFeed: NSObject, UniqueIdScriptingObject, ScriptingObjec account.createFeed(url: url, name: titleFromArgs, container: container, validateFeed: true) { result in switch result { case .success(let feed): - NotificationCenter.default.post(name: .UserDidAddFeed, object: self, userInfo: [UserInfoKey.webFeed: feed]) + NotificationCenter.default.post(name: .UserDidAddFeed, object: self, userInfo: [UserInfoKey.feed: feed]) let scriptableFeed = self.scriptableFeed(feed, account:account, folder:folder) command.resumeExecution(withResult:scriptableFeed.objectSpecifier) case .failure: diff --git a/Modules/Account/Sources/Account/Account.swift b/Modules/Account/Sources/Account/Account.swift index ee0ed476e..d2d3d8646 100644 --- a/Modules/Account/Sources/Account/Account.swift +++ b/Modules/Account/Sources/Account/Account.swift @@ -1007,7 +1007,7 @@ extension Account: FeedMetadataDelegate { func valueDidChange(_ feedMetadata: FeedMetadata, key: FeedMetadata.CodingKeys) { feedMetadataFile.markAsDirty() - guard let feed = existingWebFeed(withWebFeedID: feedMetadata.feedID) else { + guard let feed = existingFeed(withFeedID: feedMetadata.feedID) else { return } feed.postFeedSettingDidChangeNotification(key) @@ -1374,11 +1374,11 @@ private extension Account { extension Account { - public func existingWebFeed(withWebFeedID webFeedID: String) -> Feed? { - return idToFeedDictionary[webFeedID] + public func existingFeed(withFeedID feedID: String) -> Feed? { + return idToFeedDictionary[feedID] } - public func existingWebFeed(withExternalID externalID: String) -> Feed? { + public func existingFeed(withExternalID externalID: String) -> Feed? { return externalIDToFeedDictionary[externalID] } diff --git a/Modules/Account/Sources/Account/AccountManager.swift b/Modules/Account/Sources/Account/AccountManager.swift index cf188d0e9..ca0d8c4ea 100644 --- a/Modules/Account/Sources/Account/AccountManager.swift +++ b/Modules/Account/Sources/Account/AccountManager.swift @@ -218,7 +218,7 @@ public final class AccountManager: UnreadCountProvider { } case .webFeed(let accountID, let webFeedID): if let account = existingAccount(with: accountID) { - return account.existingWebFeed(withWebFeedID: webFeedID) + return account.existingFeed(withFeedID: webFeedID) } default: break @@ -335,7 +335,7 @@ public final class AccountManager: UnreadCountProvider { public func anyAccountHasFeedWithURL(_ urlString: String) -> Bool { for account in activeAccounts { - if let _ = account.existingWebFeed(withURL: urlString) { + if let _ = account.existingFeed(withURL: urlString) { return true } } diff --git a/Modules/Account/Sources/Account/CloudKit/CloudKitAccountDelegate.swift b/Modules/Account/Sources/Account/CloudKit/CloudKitAccountDelegate.swift index 747d1a21d..3ece16782 100644 --- a/Modules/Account/Sources/Account/CloudKit/CloudKitAccountDelegate.swift +++ b/Modules/Account/Sources/Account/CloudKit/CloudKitAccountDelegate.swift @@ -210,7 +210,7 @@ final class CloudKitAccountDelegate: AccountDelegate { } func removeFeed(for account: Account, with feed: Feed, from container: Container, completion: @escaping (Result) -> Void) { - removeWebFeedFromCloud(for: account, with: feed, from: container) { result in + removeFeedFromCloud(for: account, with: feed, from: container) { result in switch result { case .success: account.clearFeedMetadata(feed) @@ -311,18 +311,18 @@ final class CloudKitAccountDelegate: AccountDelegate { accountZone.findWebFeedExternalIDs(for: folder) { result in self.syncProgress.completeTask() switch result { - case .success(let webFeedExternalIDs): + case .success(let feedExternalIDs): - let webFeeds = webFeedExternalIDs.compactMap { account.existingWebFeed(withExternalID: $0) } + let feeds = feedExternalIDs.compactMap { account.existingFeed(withExternalID: $0) } let group = DispatchGroup() var errorOccurred = false - for webFeed in webFeeds { + for feed in feeds { group.enter() - self.removeWebFeedFromCloud(for: account, with: webFeed, from: folder) { result in + self.removeFeedFromCloud(for: account, with: feed, from: folder) { result in group.leave() if case .failure(let error) = result { - Self.logger.error("CloudKit: Remove folder, remove webfeed error: \(error.localizedDescription)") + Self.logger.error("CloudKit: Remove folder, remove feed error: \(error.localizedDescription)") errorOccurred = true } } @@ -790,9 +790,9 @@ private extension CloudKitAccountDelegate { } - func removeWebFeedFromCloud(for account: Account, with feed: Feed, from container: Container, completion: @escaping (Result) -> Void) { + func removeFeedFromCloud(for account: Account, with feed: Feed, from container: Container, completion: @escaping (Result) -> Void) { syncProgress.addToNumberOfTasksAndRemaining(2) - accountZone.removeWebFeed(feed, from: container) { result in + accountZone.removeFeed(feed, from: container) { result in self.syncProgress.completeTask() switch result { case .success: diff --git a/Modules/Account/Sources/Account/CloudKit/CloudKitAccountZone.swift b/Modules/Account/Sources/Account/CloudKit/CloudKitAccountZone.swift index 2ed1f0662..e37f70706 100644 --- a/Modules/Account/Sources/Account/CloudKit/CloudKitAccountZone.swift +++ b/Modules/Account/Sources/Account/CloudKit/CloudKitAccountZone.swift @@ -138,13 +138,13 @@ final class CloudKitAccountZone: CloudKitZone { } /// Removes a web feed from a container and optionally deletes it, calling the completion with true if deleted - func removeWebFeed(_ webFeed: Feed, from: Container, completion: @escaping (Result) -> Void) { + func removeFeed(_ feed: Feed, from: Container, completion: @escaping (Result) -> Void) { guard let fromContainerExternalID = from.externalID else { completion(.failure(CloudKitZoneError.corruptAccount)) return } - fetch(externalID: webFeed.externalID) { result in + fetch(externalID: feed.externalID) { result in switch result { case .success(let record): @@ -153,7 +153,7 @@ final class CloudKitAccountZone: CloudKitZone { containerExternalIDSet.remove(fromContainerExternalID) if containerExternalIDSet.isEmpty { - self.delete(externalID: webFeed.externalID) { result in + self.delete(externalID: feed.externalID) { result in switch result { case .success: completion(.success(true)) diff --git a/Modules/Account/Sources/Account/CloudKit/CloudKitAccountZoneDelegate.swift b/Modules/Account/Sources/Account/CloudKit/CloudKitAccountZoneDelegate.swift index 12ace5395..d7e318a5d 100644 --- a/Modules/Account/Sources/Account/CloudKit/CloudKitAccountZoneDelegate.swift +++ b/Modules/Account/Sources/Account/CloudKit/CloudKitAccountZoneDelegate.swift @@ -65,7 +65,7 @@ final class CloudKitAcountZoneDelegate: CloudKitZoneDelegate { let editedName = record[CloudKitAccountZone.CloudKitWebFeed.Fields.editedName] as? String let homePageURL = record[CloudKitAccountZone.CloudKitWebFeed.Fields.homePageURL] as? String - if let webFeed = account.existingWebFeed(withExternalID: record.externalID) { + if let webFeed = account.existingFeed(withExternalID: record.externalID) { updateWebFeed(webFeed, name: name, editedName: editedName, homePageURL: homePageURL, containerExternalIDs: containerExternalIDs) } else { for containerExternalID in containerExternalIDs { @@ -79,7 +79,7 @@ final class CloudKitAcountZoneDelegate: CloudKitZoneDelegate { } func removeWebFeed(_ externalID: String) { - if let webFeed = account?.existingWebFeed(withExternalID: externalID), let containers = account?.existingContainers(withFeed: webFeed) { + if let webFeed = account?.existingFeed(withExternalID: externalID), let containers = account?.existingContainers(withFeed: webFeed) { for container in containers { webFeed.dropConditionalGetInfo() container.removeWebFeed(webFeed) @@ -167,7 +167,7 @@ private extension CloudKitAcountZoneDelegate { func createWebFeedIfNecessary(url: URL, name: String?, editedName: String?, homePageURL: String?, webFeedExternalID: String, container: Container) { guard let account = account else { return } - if account.existingWebFeed(withExternalID: webFeedExternalID) != nil { + if account.existingFeed(withExternalID: webFeedExternalID) != nil { return } diff --git a/Modules/Account/Sources/Account/Container.swift b/Modules/Account/Sources/Account/Container.swift index 5fbb5b8c7..60785cae6 100644 --- a/Modules/Account/Sources/Account/Container.swift +++ b/Modules/Account/Sources/Account/Container.swift @@ -37,9 +37,9 @@ public protocol Container: AnyObject, ContainerIdentifiable { func has(_ webFeed: Feed) -> Bool func hasWebFeed(with webFeedID: String) -> Bool func hasWebFeed(withURL url: String) -> Bool - func existingWebFeed(withWebFeedID: String) -> Feed? - func existingWebFeed(withURL url: String) -> Feed? - func existingWebFeed(withExternalID externalID: String) -> Feed? + func existingFeed(withFeedID: String) -> Feed? + func existingFeed(withURL url: String) -> Feed? + func existingFeed(withExternalID externalID: String) -> Feed? func existingFolder(with name: String) -> Folder? func existingFolder(withID: Int) -> Folder? @@ -90,18 +90,18 @@ public extension Container { } func hasWebFeed(with webFeedID: String) -> Bool { - return existingWebFeed(withWebFeedID: webFeedID) != nil + return existingFeed(withFeedID: webFeedID) != nil } func hasWebFeed(withURL url: String) -> Bool { - return existingWebFeed(withURL: url) != nil + return existingFeed(withURL: url) != nil } func has(_ webFeed: Feed) -> Bool { return flattenedFeeds().contains(webFeed) } - func existingWebFeed(withWebFeedID webFeedID: String) -> Feed? { + func existingFeed(withFeedID webFeedID: String) -> Feed? { for feed in flattenedFeeds() { if feed.webFeedID == webFeedID { return feed @@ -110,7 +110,7 @@ public extension Container { return nil } - func existingWebFeed(withURL url: String) -> Feed? { + func existingFeed(withURL url: String) -> Feed? { for feed in flattenedFeeds() { if feed.url == url { return feed @@ -119,7 +119,7 @@ public extension Container { return nil } - func existingWebFeed(withExternalID externalID: String) -> Feed? { + func existingFeed(withExternalID externalID: String) -> Feed? { for feed in flattenedFeeds() { if feed.externalID == externalID { return feed diff --git a/Modules/Account/Sources/Account/DataExtensions.swift b/Modules/Account/Sources/Account/DataExtensions.swift index e9a244941..bdbb4d4c0 100644 --- a/Modules/Account/Sources/Account/DataExtensions.swift +++ b/Modules/Account/Sources/Account/DataExtensions.swift @@ -58,7 +58,7 @@ public extension Article { } var feed: Feed? { - return account?.existingWebFeed(withWebFeedID: feedID) + return account?.existingFeed(withFeedID: feedID) } } diff --git a/Modules/Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift b/Modules/Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift index 077eee27d..567eac99f 100644 --- a/Modules/Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift +++ b/Modules/Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift @@ -505,7 +505,7 @@ final class FeedbinAccountDelegate: AccountDelegate { func restoreFeed(for account: Account, feed: Feed, container: Container, completion: @escaping (Result) -> Void) { - if let existingFeed = account.existingWebFeed(withURL: feed.url) { + if let existingFeed = account.existingFeed(withURL: feed.url) { account.addFeed(existingFeed, to: container) { result in switch result { case .success: @@ -839,7 +839,7 @@ private extension FeedbinAccountDelegate { let subFeedId = String(subscription.feedID) - if let feed = account.existingWebFeed(withWebFeedID: subFeedId) { + if let feed = account.existingFeed(withFeedID: subFeedId) { feed.name = subscription.name // If the name has been changed on the server remove the locally edited name feed.editedName = nil @@ -903,7 +903,7 @@ private extension FeedbinAccountDelegate { for tagging in groupedTaggings { let taggingFeedID = String(tagging.feedID) if !folderFeedIds.contains(taggingFeedID) { - guard let feed = account.existingWebFeed(withWebFeedID: taggingFeedID) else { + guard let feed = account.existingFeed(withFeedID: taggingFeedID) else { continue } saveFolderRelationship(for: feed, withFolderName: folderName, id: String(tagging.taggingID)) diff --git a/Modules/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift b/Modules/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift index efcd45320..ebcce0a5c 100644 --- a/Modules/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift +++ b/Modules/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift @@ -463,7 +463,7 @@ final class FeedlyAccountDelegate: AccountDelegate { } func restoreFeed(for account: Account, feed: Feed, container: Container, completion: @escaping (Result) -> Void) { - if let existingFeed = account.existingWebFeed(withURL: feed.url) { + if let existingFeed = account.existingFeed(withURL: feed.url) { account.addFeed(existingFeed, to: container) { result in switch result { case .success: diff --git a/Modules/Account/Sources/Account/Feedly/Operations/FeedlyAddNewFeedOperation.swift b/Modules/Account/Sources/Account/Feedly/Operations/FeedlyAddNewFeedOperation.swift index f835b7db0..de99cc228 100644 --- a/Modules/Account/Sources/Account/Feedly/Operations/FeedlyAddNewFeedOperation.swift +++ b/Modules/Account/Sources/Account/Feedly/Operations/FeedlyAddNewFeedOperation.swift @@ -135,7 +135,7 @@ final class FeedlyAddNewFeedOperation: FeedlyOperation, FeedlyOperationDelegate, guard let handler = addCompletionHandler else { return } - if let feedResource = feedResourceId, let feed = folder.existingWebFeed(withWebFeedID: feedResource.id) { + if let feedResource = feedResourceId, let feed = folder.existingFeed(withFeedID: feedResource.id) { handler(.success(feed)) } else { diff --git a/Modules/Account/Sources/Account/Feedly/Operations/FeedlyCreateFeedsForCollectionFoldersOperation.swift b/Modules/Account/Sources/Account/Feedly/Operations/FeedlyCreateFeedsForCollectionFoldersOperation.swift index fcb7ac4cf..931499ce8 100644 --- a/Modules/Account/Sources/Account/Feedly/Operations/FeedlyCreateFeedsForCollectionFoldersOperation.swift +++ b/Modules/Account/Sources/Account/Feedly/Operations/FeedlyCreateFeedsForCollectionFoldersOperation.swift @@ -56,7 +56,7 @@ final class FeedlyCreateFeedsForCollectionFoldersOperation: FeedlyOperation { .compactMap { (collectionFeed, folder) -> (Feed, Folder) in // find an existing feed previously added to the account - if let feed = account.existingWebFeed(withWebFeedID: collectionFeed.id) { + if let feed = account.existingFeed(withFeedID: collectionFeed.id) { // If the feed was renamed on Feedly, ensure we ingest the new name. if feed.nameForDisplay != collectionFeed.title { diff --git a/Modules/Account/Sources/Account/NewsBlur/Internals/NewsBlurAccountDelegate+Internal.swift b/Modules/Account/Sources/Account/NewsBlur/Internals/NewsBlurAccountDelegate+Internal.swift index df32a3140..c19cf148e 100644 --- a/Modules/Account/Sources/Account/NewsBlur/Internals/NewsBlurAccountDelegate+Internal.swift +++ b/Modules/Account/Sources/Account/NewsBlur/Internals/NewsBlurAccountDelegate+Internal.swift @@ -103,7 +103,7 @@ extension NewsBlurAccountDelegate { feeds.forEach { feed in let subFeedId = String(feed.feedID) - if let webFeed = account.existingWebFeed(withWebFeedID: subFeedId) { + if let webFeed = account.existingFeed(withFeedID: subFeedId) { webFeed.name = feed.name // If the name has been changed on the server remove the locally edited name webFeed.editedName = nil @@ -169,7 +169,7 @@ extension NewsBlurAccountDelegate { for relationship in folderRelationships { let folderFeedID = String(relationship.feedID) if !folderFeedIds.contains(folderFeedID) { - guard let feed = account.existingWebFeed(withWebFeedID: folderFeedID) else { + guard let feed = account.existingFeed(withFeedID: folderFeedID) else { continue } saveFolderRelationship(for: feed, withFolderName: folderName, id: relationship.folderName) @@ -541,7 +541,7 @@ extension NewsBlurAccountDelegate { } } - if account.existingWebFeed(withWebFeedID: feedID) != nil { + if account.existingFeed(withFeedID: feedID) != nil { account.clearFeedMetadata(feed) } diff --git a/Modules/Account/Sources/Account/NewsBlur/NewsBlurAccountDelegate.swift b/Modules/Account/Sources/Account/NewsBlur/NewsBlurAccountDelegate.swift index 36862b014..345a3842a 100644 --- a/Modules/Account/Sources/Account/NewsBlur/NewsBlurAccountDelegate.swift +++ b/Modules/Account/Sources/Account/NewsBlur/NewsBlurAccountDelegate.swift @@ -522,7 +522,7 @@ final class NewsBlurAccountDelegate: AccountDelegate { } func restoreFeed(for account: Account, feed: Feed, container: Container, completion: @escaping (Result) -> ()) { - if let existingFeed = account.existingWebFeed(withURL: feed.url) { + if let existingFeed = account.existingFeed(withURL: feed.url) { account.addFeed(existingFeed, to: container) { result in switch result { case .success: diff --git a/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift b/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift index 8f38c6736..825d2aada 100644 --- a/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift +++ b/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift @@ -555,7 +555,7 @@ final class ReaderAPIAccountDelegate: AccountDelegate { func restoreFeed(for account: Account, feed: Feed, container: Container, completion: @escaping (Result) -> Void) { - if let existingFeed = account.existingWebFeed(withURL: feed.url) { + if let existingFeed = account.existingFeed(withURL: feed.url) { account.addFeed(existingFeed, to: container) { result in switch result { case .success: @@ -773,7 +773,7 @@ private extension ReaderAPIAccountDelegate { // Add any feeds we don't have and update any we do subscriptions.forEach { subscription in - if let feed = account.existingWebFeed(withWebFeedID: subscription.feedID) { + if let feed = account.existingFeed(withFeedID: subscription.feedID) { feed.name = subscription.name feed.editedName = nil feed.homePageURL = subscription.homePageURL @@ -829,7 +829,7 @@ private extension ReaderAPIAccountDelegate { for subscription in groupedTaggings { let taggingFeedID = subscription.feedID if !folderFeedIds.contains(taggingFeedID) { - guard let feed = account.existingWebFeed(withWebFeedID: taggingFeedID) else { + guard let feed = account.existingFeed(withFeedID: taggingFeedID) else { continue } saveFolderRelationship(for: feed, folderExternalID: folderExternalID, feedExternalID: subscription.feedID) diff --git a/Shared/Activity/ActivityManager.swift b/Shared/Activity/ActivityManager.swift index c380b8405..6e97b2822 100644 --- a/Shared/Activity/ActivityManager.swift +++ b/Shared/Activity/ActivityManager.swift @@ -40,7 +40,7 @@ final class ActivityManager { } init() { - NotificationCenter.default.addObserver(self, selector: #selector(webFeedIconDidBecomeAvailable(_:)), name: .feedIconDidBecomeAvailable, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(feedIconDidBecomeAvailable(_:)), name: .feedIconDidBecomeAvailable, object: nil) } func invalidateCurrentActivities() { @@ -140,8 +140,8 @@ final class ActivityManager { } #endif - @objc func webFeedIconDidBecomeAvailable(_ note: Notification) { - guard let webFeed = note.userInfo?[UserInfoKey.webFeed] as? Feed, let activityFeedId = selectingActivity?.userInfo?[ArticlePathKey.webFeedID] as? String else { + @objc func feedIconDidBecomeAvailable(_ note: Notification) { + guard let feed = note.userInfo?[UserInfoKey.feed] as? Feed, let activityFeedId = selectingActivity?.userInfo?[ArticlePathKey.feedID] as? String else { return } @@ -151,8 +151,8 @@ final class ActivityManager { } #endif - if activityFeedId == webFeed.webFeedID { - updateSelectingActivityFeedSearchAttributes(with: webFeed) + if activityFeedId == feed.webFeedID { + updateSelectingActivityFeedSearchAttributes(with: feed) } } diff --git a/Shared/Extensions/ArticleUtilities.swift b/Shared/Extensions/ArticleUtilities.swift index 1caa6cb5d..53d4aed2c 100644 --- a/Shared/Extensions/ArticleUtilities.swift +++ b/Shared/Extensions/ArticleUtilities.swift @@ -43,7 +43,7 @@ private func accountAndArticlesDictionary(_ articles: Set
) -> [String: extension Article { var feed: Feed? { - return account?.existingWebFeed(withWebFeedID: feedID) + return account?.existingFeed(withFeedID: feedID) } var url: URL? { @@ -189,7 +189,7 @@ extension Article { struct ArticlePathKey { static let accountID = "accountID" static let accountName = "accountName" - static let webFeedID = "webFeedID" + static let feedID = "feedID" static let articleID = "articleID" } @@ -199,7 +199,7 @@ extension Article { return [ ArticlePathKey.accountID: accountID, ArticlePathKey.accountName: account?.nameForDisplay ?? "", - ArticlePathKey.webFeedID: feedID, + ArticlePathKey.feedID: feedID, ArticlePathKey.articleID: articleID ] } diff --git a/Shared/Images/FeedIconDownloader.swift b/Shared/Images/FeedIconDownloader.swift index f57bf0f8a..2ff0de464 100644 --- a/Shared/Images/FeedIconDownloader.swift +++ b/Shared/Images/FeedIconDownloader.swift @@ -167,7 +167,7 @@ private extension FeedIconDownloader { func postFeedIconDidBecomeAvailableNotification(_ feed: Feed) { DispatchQueue.main.async { - let userInfo: [AnyHashable: Any] = [UserInfoKey.webFeed: feed] + let userInfo: [AnyHashable: Any] = [UserInfoKey.feed: feed] NotificationCenter.default.post(name: .feedIconDidBecomeAvailable, object: self, userInfo: userInfo) } } diff --git a/Shared/UserInfoKey.swift b/Shared/UserInfoKey.swift index e9aaa21fc..ae44ca44e 100644 --- a/Shared/UserInfoKey.swift +++ b/Shared/UserInfoKey.swift @@ -10,7 +10,7 @@ import Foundation struct UserInfoKey { - static let webFeed = "webFeed" + static let feed = "feed" static let url = "url" static let articlePath = "articlePath" static let feedIdentifier = "feedIdentifier" diff --git a/iOS/Add/AddFeedViewController.swift b/iOS/Add/AddFeedViewController.swift index f29f40591..7a35d12a8 100644 --- a/iOS/Add/AddFeedViewController.swift +++ b/iOS/Add/AddFeedViewController.swift @@ -113,7 +113,7 @@ final class AddFeedViewController: UITableViewController { switch result { case .success(let feed): self.dismiss(animated: true) - NotificationCenter.default.post(name: .UserDidAddFeed, object: self, userInfo: [UserInfoKey.webFeed: feed]) + NotificationCenter.default.post(name: .UserDidAddFeed, object: self, userInfo: [UserInfoKey.feed: feed]) case .failure(let error): self.addButton.isEnabled = true self.activityIndicator.stopAnimating() diff --git a/iOS/Article/WebViewController.swift b/iOS/Article/WebViewController.swift index 66f145b4b..c7865f3a8 100644 --- a/iOS/Article/WebViewController.swift +++ b/iOS/Article/WebViewController.swift @@ -70,7 +70,7 @@ final class WebViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - NotificationCenter.default.addObserver(self, selector: #selector(webFeedIconDidBecomeAvailable(_:)), name: .feedIconDidBecomeAvailable, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(feedIconDidBecomeAvailable(_:)), name: .feedIconDidBecomeAvailable, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(avatarDidBecomeAvailable(_:)), name: .AvatarDidBecomeAvailable, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(faviconDidBecomeAvailable(_:)), name: .FaviconDidBecomeAvailable, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(currentArticleThemeDidChangeNotification(_:)), name: .CurrentArticleThemeDidChangeNotification, object: nil) @@ -84,7 +84,7 @@ final class WebViewController: UIViewController { // MARK: Notifications - @objc func webFeedIconDidBecomeAvailable(_ note: Notification) { + @objc func feedIconDidBecomeAvailable(_ note: Notification) { reloadArticleImage() } diff --git a/iOS/Inspector/FeedInspectorViewController.swift b/iOS/Inspector/FeedInspectorViewController.swift index f9ea47665..b6c5765cf 100644 --- a/iOS/Inspector/FeedInspectorViewController.swift +++ b/iOS/Inspector/FeedInspectorViewController.swift @@ -48,7 +48,7 @@ final class FeedInspectorViewController: UITableViewController { homePageLabel.text = webFeed.homePageURL feedURLLabel.text = webFeed.url - NotificationCenter.default.addObserver(self, selector: #selector(webFeedIconDidBecomeAvailable(_:)), name: .feedIconDidBecomeAvailable, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(feedIconDidBecomeAvailable(_:)), name: .feedIconDidBecomeAvailable, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(updateNotificationSettings), name: UIApplication.willEnterForegroundNotification, object: nil) @@ -67,7 +67,7 @@ final class FeedInspectorViewController: UITableViewController { } // MARK: Notifications - @objc func webFeedIconDidBecomeAvailable(_ notification: Notification) { + @objc func feedIconDidBecomeAvailable(_ notification: Notification) { headerView?.iconView.iconImage = iconImage } diff --git a/iOS/MainFeed/MainFeedCollectionViewController+Drop.swift b/iOS/MainFeed/MainFeedCollectionViewController+Drop.swift index ca1cca4e1..549429dfe 100644 --- a/iOS/MainFeed/MainFeedCollectionViewController+Drop.swift +++ b/iOS/MainFeed/MainFeedCollectionViewController+Drop.swift @@ -126,7 +126,7 @@ extension MainFeedCollectionViewController: UICollectionViewDropDelegate { func moveWebFeedBetweenAccounts(feed: Feed, sourceContainer: Container, destinationContainer: Container) { - if let existingFeed = destinationContainer.account?.existingWebFeed(withURL: feed.url) { + if let existingFeed = destinationContainer.account?.existingFeed(withURL: feed.url) { BatchUpdate.shared.start() destinationContainer.account?.addFeed(existingFeed, to: destinationContainer) { result in diff --git a/iOS/MainFeed/MainFeedCollectionViewController.swift b/iOS/MainFeed/MainFeedCollectionViewController.swift index 6814d7c3d..6b81f9911 100644 --- a/iOS/MainFeed/MainFeedCollectionViewController.swift +++ b/iOS/MainFeed/MainFeedCollectionViewController.swift @@ -115,7 +115,7 @@ class MainFeedCollectionViewController: UICollectionViewController, UndoableComm // always know when an image is available — but watching the .htmlMetadataAvailable Notification // lets us know that it’s time to request an image. NotificationCenter.default.addObserver(self, selector: #selector(faviconDidBecomeAvailable(_:)), name: .htmlMetadataAvailable, object: nil) - NotificationCenter.default.addObserver(self, selector: #selector(webFeedIconDidBecomeAvailable(_:)), name: .feedIconDidBecomeAvailable, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(feedIconDidBecomeAvailable(_:)), name: .feedIconDidBecomeAvailable, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(webFeedSettingDidChange(_:)), name: .WebFeedSettingDidChange, object: nil) registerForTraitChanges([UITraitPreferredContentSizeCategory.self], target: self, action: #selector(preferredContentSizeCategoryDidChange)) @@ -669,11 +669,11 @@ class MainFeedCollectionViewController: UICollectionViewController, UndoableComm applyToAvailableCells(configureIcon) } - @objc func webFeedIconDidBecomeAvailable(_ note: Notification) { - guard let webFeed = note.userInfo?[UserInfoKey.webFeed] as? Feed else { + @objc func feedIconDidBecomeAvailable(_ note: Notification) { + guard let feed = note.userInfo?[UserInfoKey.feed] as? Feed else { return } - applyToCellsForRepresentedObject(webFeed, configureIcon(_:_:)) + applyToCellsForRepresentedObject(feed, configureIcon(_:_:)) } // MARK: - Actions @@ -681,24 +681,24 @@ class MainFeedCollectionViewController: UICollectionViewController, UndoableComm func configureContextMenu(_: Any? = nil) { /* Context Menu Order: - 1. Add Web Feed + 1. Add Feed 2. Add Folder */ var menuItems: [UIAction] = [] - let addWebFeedActionTitle = NSLocalizedString("Add Feed", comment: "Add Feed") - let addWebFeedAction = UIAction(title: addWebFeedActionTitle, image: AppAssets.plus) { _ in + let addFeedActionTitle = NSLocalizedString("Add Feed", comment: "Add Feed") + let addFeedAction = UIAction(title: addFeedActionTitle, image: AppAssets.plus) { _ in self.coordinator.showAddWebFeed() } - menuItems.append(addWebFeedAction) + menuItems.append(addFeedAction) - let addWebFolderActionTitle = NSLocalizedString("Add Folder", comment: "Add Folder") - let addWebFolderAction = UIAction(title: addWebFolderActionTitle, image: AppAssets.folderOutlinePlus) { _ in + let addFolderActionTitle = NSLocalizedString("Add Folder", comment: "Add Folder") + let addFolderAction = UIAction(title: addFolderActionTitle, image: AppAssets.folderOutlinePlus) { _ in self.coordinator.showAddFolder() } - menuItems.append(addWebFolderAction) + menuItems.append(addFolderAction) let contextMenu = UIMenu(title: NSLocalizedString("Add Item", comment: "Add Item"), image: nil, identifier: nil, options: [], children: menuItems.reversed()) diff --git a/iOS/MainTimeline/MainTimelineViewController.swift b/iOS/MainTimeline/MainTimelineViewController.swift index 3a69119dc..56ca2a015 100644 --- a/iOS/MainTimeline/MainTimelineViewController.swift +++ b/iOS/MainTimeline/MainTimelineViewController.swift @@ -142,7 +142,7 @@ final class MainTimelineViewController: UITableViewController, UndoableCommandRu NotificationCenter.default.addObserver(self, selector: #selector(unreadCountDidChange(_:)), name: .UnreadCountDidChange, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(statusesDidChange(_:)), name: .StatusesDidChange, object: nil) - NotificationCenter.default.addObserver(self, selector: #selector(webFeedIconDidBecomeAvailable(_:)), name: .feedIconDidBecomeAvailable, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(feedIconDidBecomeAvailable(_:)), name: .feedIconDidBecomeAvailable, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(avatarDidBecomeAvailable(_:)), name: .AvatarDidBecomeAvailable, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(faviconDidBecomeAvailable(_:)), name: .FaviconDidBecomeAvailable, object: nil) @@ -610,9 +610,9 @@ final class MainTimelineViewController: UITableViewController, UndoableCommandRu } } - @objc func webFeedIconDidBecomeAvailable(_ note: Notification) { + @objc func feedIconDidBecomeAvailable(_ note: Notification) { - guard let feed = note.userInfo?[UserInfoKey.webFeed] as? Feed else { + guard let feed = note.userInfo?[UserInfoKey.feed] as? Feed else { return } tableView.indexPathsForVisibleRows?.forEach { indexPath in diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index 490318496..c0ff7029d 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -507,7 +507,7 @@ final class SceneCoordinator: NSObject, UndoableCommandRunner { } @objc func userDidAddFeed(_ notification: Notification) { - guard let webFeed = notification.userInfo?[UserInfoKey.webFeed] as? Feed else { + guard let webFeed = notification.userInfo?[UserInfoKey.feed] as? Feed else { return } discloseWebFeed(webFeed, animations: [.scroll, .navigation]) @@ -1518,7 +1518,7 @@ private extension SceneCoordinator { treeControllerDelegate.addFilterException(sidebarItemID) } } else if let webFeed = sidebarItem as? Feed { - if webFeed.account?.existingWebFeed(withWebFeedID: webFeed.webFeedID) != nil { + if webFeed.account?.existingFeed(withFeedID: webFeed.webFeedID) != nil { treeControllerDelegate.addFilterException(sidebarItemID) addParentFolderToFilterExceptions(webFeed) } @@ -2043,7 +2043,7 @@ private extension SceneCoordinator { if !unsortedArticleIDs.contains(article.articleID) { updatedArticles.insert(article) } - if article.account?.existingWebFeed(withWebFeedID: article.feedID) == nil { + if article.account?.existingFeed(withFeedID: article.feedID) == nil { updatedArticles.remove(article) } } @@ -2200,7 +2200,7 @@ private extension SceneCoordinator { case .webFeed(let accountID, let webFeedID): guard let accountNode = findAccountNode(accountID: accountID), let account = accountNode.representedObject as? Account, - let webFeed = account.existingWebFeed(withWebFeedID: webFeedID) else { + let webFeed = account.existingFeed(withFeedID: webFeedID) else { return } @@ -2216,7 +2216,7 @@ private extension SceneCoordinator { guard let articlePathUserInfo = userInfo[UserInfoKey.articlePath] as? [AnyHashable : Any], let accountID = articlePathUserInfo[ArticlePathKey.accountID] as? String, let accountName = articlePathUserInfo[ArticlePathKey.accountName] as? String, - let webFeedID = articlePathUserInfo[ArticlePathKey.webFeedID] as? String, + let webFeedID = articlePathUserInfo[ArticlePathKey.feedID] as? String, let articleID = articlePathUserInfo[ArticlePathKey.articleID] as? String, let accountNode = findAccountNode(accountID: accountID, accountName: accountName), let account = accountNode.representedObject as? Account else { @@ -2229,7 +2229,7 @@ private extension SceneCoordinator { return } - guard let webFeed = account.existingWebFeed(withWebFeedID: webFeedID) else { + guard let webFeed = account.existingFeed(withFeedID: webFeedID) else { return }