From c18575ea85a464e1f5e8a83cb8e43a1c8e735c54 Mon Sep 17 00:00:00 2001 From: Kiel Gillard Date: Fri, 17 Jan 2020 15:25:57 +1100 Subject: [PATCH] Let Feedly users add to the uncategorized collection/folder. --- .../Account/Feedly/FeedlyFeedContainerValidator.swift | 11 ----------- .../Operations/FeedlyAddExistingFeedOperation.swift | 2 +- .../Feedly/Operations/FeedlyAddNewFeedOperation.swift | 2 +- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/Frameworks/Account/Feedly/FeedlyFeedContainerValidator.swift b/Frameworks/Account/Feedly/FeedlyFeedContainerValidator.swift index 62bc0c4f4..da4e6fb81 100644 --- a/Frameworks/Account/Feedly/FeedlyFeedContainerValidator.swift +++ b/Frameworks/Account/Feedly/FeedlyFeedContainerValidator.swift @@ -10,7 +10,6 @@ import Foundation struct FeedlyFeedContainerValidator { var container: Container - var userId: String? func getValidContainer() throws -> (Folder, String) { guard let folder = container as? Folder else { @@ -21,16 +20,6 @@ struct FeedlyFeedContainerValidator { throw FeedlyAccountDelegateError.addFeedInvalidFolder(folder) } - guard let userId = userId else { - throw FeedlyAccountDelegateError.notLoggedIn - } - - let uncategorized = FeedlyCategoryResourceId.Global.uncategorized(for: userId) - - guard collectionId != uncategorized.id else { - throw FeedlyAccountDelegateError.addFeedInvalidFolder(folder) - } - return (folder, collectionId) } } diff --git a/Frameworks/Account/Feedly/Operations/FeedlyAddExistingFeedOperation.swift b/Frameworks/Account/Feedly/Operations/FeedlyAddExistingFeedOperation.swift index 6dcd36e91..1b921b28d 100644 --- a/Frameworks/Account/Feedly/Operations/FeedlyAddExistingFeedOperation.swift +++ b/Frameworks/Account/Feedly/Operations/FeedlyAddExistingFeedOperation.swift @@ -18,7 +18,7 @@ class FeedlyAddExistingFeedOperation: FeedlyOperation, FeedlyOperationDelegate, init(account: Account, credentials: Credentials, resource: FeedlyFeedResourceId, service: FeedlyAddFeedToCollectionService, container: Container, progress: DownloadProgress, log: OSLog) throws { - let validator = FeedlyFeedContainerValidator(container: container, userId: credentials.username) + let validator = FeedlyFeedContainerValidator(container: container) let (folder, collectionId) = try validator.getValidContainer() self.operationQueue = MainThreadOperationQueue() diff --git a/Frameworks/Account/Feedly/Operations/FeedlyAddNewFeedOperation.swift b/Frameworks/Account/Feedly/Operations/FeedlyAddNewFeedOperation.swift index 3cdf8daa8..261acb4fe 100644 --- a/Frameworks/Account/Feedly/Operations/FeedlyAddNewFeedOperation.swift +++ b/Frameworks/Account/Feedly/Operations/FeedlyAddNewFeedOperation.swift @@ -30,7 +30,7 @@ class FeedlyAddNewFeedOperation: FeedlyOperation, FeedlyOperationDelegate, Feedl init(account: Account, credentials: Credentials, url: String, feedName: String?, searchService: FeedlySearchService, addToCollectionService: FeedlyAddFeedToCollectionService, syncUnreadIdsService: FeedlyGetStreamIdsService, getStreamContentsService: FeedlyGetStreamContentsService, database: SyncDatabase, container: Container, progress: DownloadProgress, log: OSLog) throws { - let validator = FeedlyFeedContainerValidator(container: container, userId: credentials.username) + let validator = FeedlyFeedContainerValidator(container: container) (self.folder, self.collectionId) = try validator.getValidContainer() self.url = url