2020-11-09 00:58:47 +01:00
|
|
|
import SessionUtilitiesKit
|
2020-11-08 02:34:08 +01:00
|
|
|
|
|
|
|
// TODO: Implementation
|
|
|
|
|
|
|
|
public final class AttachmentDownloadJob : NSObject, Job, NSCoding { // NSObject/NSCoding conformance is needed for YapDatabase compatibility
|
2020-11-08 03:12:38 +01:00
|
|
|
public var delegate: JobDelegate?
|
|
|
|
public var failureCount: UInt = 0
|
2020-11-08 02:34:08 +01:00
|
|
|
|
|
|
|
// MARK: Settings
|
2020-11-08 03:12:38 +01:00
|
|
|
public static let maxFailureCount: UInt = 20
|
2020-11-08 02:34:08 +01:00
|
|
|
|
|
|
|
// MARK: Coding
|
|
|
|
public init?(coder: NSCoder) { }
|
|
|
|
|
|
|
|
public func encode(with coder: NSCoder) { }
|
|
|
|
|
|
|
|
// MARK: Running
|
|
|
|
public func execute() { }
|
|
|
|
|
2020-11-08 03:12:38 +01:00
|
|
|
private func handleSuccess() {
|
|
|
|
delegate?.handleJobSucceeded(self)
|
|
|
|
}
|
2020-11-08 02:34:08 +01:00
|
|
|
|
2020-11-08 03:12:38 +01:00
|
|
|
private func handleFailure(error: Error) {
|
|
|
|
delegate?.handleJobFailed(self, with: error)
|
|
|
|
}
|
2020-11-08 02:34:08 +01:00
|
|
|
}
|
|
|
|
|