2019-05-03 01:17:52 +02:00
|
|
|
//
|
|
|
|
// FeedbinAccountDelegate.swift
|
|
|
|
// Account
|
|
|
|
//
|
|
|
|
// Created by Maurice Parker on 5/2/19.
|
|
|
|
// Copyright © 2019 Ranchero Software, LLC. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
import RSWeb
|
|
|
|
|
|
|
|
final class FeedbinAccountDelegate: AccountDelegate {
|
|
|
|
|
|
|
|
let supportsSubFolders = false
|
|
|
|
|
2019-05-04 15:54:07 +02:00
|
|
|
private let caller: FeedbinAPICaller
|
2019-05-03 01:17:52 +02:00
|
|
|
|
2019-05-04 15:54:07 +02:00
|
|
|
init(transport: Transport) {
|
|
|
|
caller = FeedbinAPICaller(transport: transport)
|
2019-05-03 01:17:52 +02:00
|
|
|
}
|
|
|
|
|
2019-05-04 15:54:07 +02:00
|
|
|
var refreshProgress = DownloadProgress(numberOfTasks: 0)
|
|
|
|
|
|
|
|
static func validateCredentials(transport: Transport, username: String, password: String, completionHandler handler: @escaping (Result<Bool, Error>) -> Void) {
|
2019-05-03 01:17:52 +02:00
|
|
|
|
2019-05-04 15:54:07 +02:00
|
|
|
let caller = FeedbinAPICaller(transport: transport)
|
2019-05-03 01:17:52 +02:00
|
|
|
caller.validateCredentials(username: username, password: password) { result in
|
2019-05-04 15:54:07 +02:00
|
|
|
handler(result)
|
2019-05-03 01:17:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func refreshAll(for account: Account) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func accountDidInitialize(_ account: Account) {
|
|
|
|
}
|
|
|
|
|
|
|
|
// MARK: Disk
|
|
|
|
|
|
|
|
func update(account: Account, withUserInfo: NSDictionary?) {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func userInfo(for: Account) -> NSDictionary? {
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|