Skip to content

Commit

Permalink
Adding missing OpenHABImageDownloaderOperation to commit
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Bert <[email protected]>
  • Loading branch information
timbms committed Jan 11, 2024
1 parent a589c84 commit b129a52
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions openHABWatch/Extension/OpenHABWatchAppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
// Copyright (c) 2010-2024 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License 2.0 which is available at
// http://www.eclipse.org/legal/epl-2.0
//
// SPDX-License-Identifier: EPL-2.0

// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
Expand All @@ -12,6 +23,7 @@
import Kingfisher
import OpenHABCore
import os.log
import SDWebImage
import WatchConnectivity
import WatchKit

Expand Down Expand Up @@ -138,3 +150,17 @@ extension OpenHABWatchAppDelegate: ClientCertificateManagerDelegate {
// delegate should alert the user that an error occured importing the certificate
func alertClientCertificateError(_ clientCertificateManager: ClientCertificateManager?, errMsg: String) {}
}

// MARK: SDWebImageDownloaderOperation

class OpenHABImageDownloaderOperation: SDWebImageDownloaderOperation {
override func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
let (disposition, credential) = onReceiveSessionChallenge(with: challenge)
completionHandler(disposition, credential)
}

override func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
let (disposition, credential) = onReceiveSessionTaskChallenge(with: challenge)
completionHandler(disposition, credential)
}
}

0 comments on commit b129a52

Please sign in to comment.