diff --git a/Evergreen/SmartFeeds/SmartFeed.swift b/Evergreen/SmartFeeds/SmartFeed.swift index e623399b0..99de45209 100644 --- a/Evergreen/SmartFeeds/SmartFeed.swift +++ b/Evergreen/SmartFeeds/SmartFeed.swift @@ -11,7 +11,7 @@ import RSCore import Data import Account -protocol SmartFeedDelegate: DisplayNameProvider { +protocol SmartFeedDelegate: DisplayNameProvider, ArticleFetcher { func fetchUnreadCount(for: Account, callback: @escaping (Int) -> Void) } @@ -51,6 +51,19 @@ final class SmartFeed: PseudoFeed { } } +extension SmartFeed: ArticleFetcher { + + func fetchArticles() -> Set
{ + + return delegate.fetchArticles() + } + + func fetchUnreadArticles() -> Set
{ + + return delegate.fetchUnreadArticles() + } +} + private extension SmartFeed { // MARK: - Unread Counts diff --git a/Evergreen/SmartFeeds/StarredFeedDelegate.swift b/Evergreen/SmartFeeds/StarredFeedDelegate.swift index 424ad530a..e09ca4db9 100644 --- a/Evergreen/SmartFeeds/StarredFeedDelegate.swift +++ b/Evergreen/SmartFeeds/StarredFeedDelegate.swift @@ -19,4 +19,18 @@ struct StarredFeedDelegate: SmartFeedDelegate { account.fetchUnreadCountForStarredArticles(callback) } + + // MARK: ArticleFetcher + + func fetchArticles() -> Set
{ + + // TODO + return Set
() + } + + func fetchUnreadArticles() -> Set
{ + + return fetchArticles().unreadArticles() + } + } diff --git a/Evergreen/SmartFeeds/TodayFeedDelegate.swift b/Evergreen/SmartFeeds/TodayFeedDelegate.swift index 58ae61095..3820ba695 100644 --- a/Evergreen/SmartFeeds/TodayFeedDelegate.swift +++ b/Evergreen/SmartFeeds/TodayFeedDelegate.swift @@ -18,5 +18,18 @@ struct TodayFeedDelegate: SmartFeedDelegate { account.fetchUnreadCountForToday(callback) } + + // MARK: ArticleFetcher + + func fetchArticles() -> Set
{ + + // TODO + return Set
() + } + + func fetchUnreadArticles() -> Set
{ + + return fetchArticles().unreadArticles() + } }