diff --git a/Session/Signal/AddToBlockListViewController.m b/Session/Signal/AddToBlockListViewController.m index 8d3315238..74c5cd8db 100644 --- a/Session/Signal/AddToBlockListViewController.m +++ b/Session/Signal/AddToBlockListViewController.m @@ -63,7 +63,6 @@ NS_ASSUME_NONNULL_BEGIN { OWSAssertDebug(signalAccount); - ContactsViewHelper *helper = self.contactsViewHelper; return ![SSKEnvironment.shared.blockingManager isRecipientIdBlocked:signalAccount.recipientId]; } diff --git a/Session/Signal/ConversationView/ConversationViewModel.m b/Session/Signal/ConversationView/ConversationViewModel.m index cf50fcf4d..3b9557422 100644 --- a/Session/Signal/ConversationView/ConversationViewModel.m +++ b/Session/Signal/ConversationView/ConversationViewModel.m @@ -1073,7 +1073,6 @@ static const int kYapDatabaseRangeMaxLength = 25000; }; NSMutableSet *interactionIds = [NSMutableSet new]; - BOOL canLoadMoreItems = self.messageMapping.canLoadMore; [self.uiDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) { NSMutableArray *interactions = [NSMutableArray new]; diff --git a/SessionMessagingKit/Database/Storage+Jobs.swift b/SessionMessagingKit/Database/Storage+Jobs.swift index 8e9b5ab95..e07321f08 100644 --- a/SessionMessagingKit/Database/Storage+Jobs.swift +++ b/SessionMessagingKit/Database/Storage+Jobs.swift @@ -82,7 +82,9 @@ extension Storage { } public func resumeMessageSendJobIfNeeded(_ messageSendJobID: String) { - getMessageSendJob(for: messageSendJobID)?.execute() + guard let job = getMessageSendJob(for: messageSendJobID) else { return } + job.delegate = JobQueue.shared + job.execute() } public func isJobCanceled(_ job: Job) -> Bool { diff --git a/SessionMessagingKit/Jobs/JobQueue.swift b/SessionMessagingKit/Jobs/JobQueue.swift index e80060aa8..81a8f1859 100644 --- a/SessionMessagingKit/Jobs/JobQueue.swift +++ b/SessionMessagingKit/Jobs/JobQueue.swift @@ -97,6 +97,7 @@ public final class JobQueue : NSObject, JobDelegate { @objc private func retry(_ timer: Timer) { guard let job = timer.userInfo as? Job else { return } SNLog("Retrying \(type(of: job)).") + job.delegate = self job.execute() } } diff --git a/SessionMessagingKit/Sending & Receiving/Pollers/OpenGroupPoller.swift b/SessionMessagingKit/Sending & Receiving/Pollers/OpenGroupPoller.swift index f47d66490..c08d71072 100644 --- a/SessionMessagingKit/Sending & Receiving/Pollers/OpenGroupPoller.swift +++ b/SessionMessagingKit/Sending & Receiving/Pollers/OpenGroupPoller.swift @@ -48,7 +48,8 @@ public final class OpenGroupPoller : NSObject { public func objc_pollForNewMessages() -> AnyPromise { AnyPromise.from(pollForNewMessages()) } - + + @discardableResult public func pollForNewMessages() -> Promise { guard !self.isPolling else { return Promise.value(()) } self.isPolling = true diff --git a/SessionUtilitiesKit/ProxiedContentDownloader.swift b/SessionUtilitiesKit/ProxiedContentDownloader.swift index f01286dd6..644bf49b6 100644 --- a/SessionUtilitiesKit/ProxiedContentDownloader.swift +++ b/SessionUtilitiesKit/ProxiedContentDownloader.swift @@ -299,7 +299,7 @@ public class ProxiedContentAssetRequest: NSObject { try assetData.write(to: NSURL.fileURL(withPath: filePath), options: .atomicWrite) let asset = ProxiedContentAsset(assetDescription: assetDescription, filePath: filePath) return asset - } catch let error as NSError { + } catch { return nil } } @@ -366,7 +366,7 @@ public class ProxiedContentAsset: NSObject { do { let fileManager = FileManager.default try fileManager.removeItem(atPath: filePathCopy) - } catch let error as NSError { + } catch { } } @@ -801,7 +801,7 @@ open class ProxiedContentDownloader: NSObject, URLSessionTaskDelegate, URLSessio segmentRequestDidFail(assetRequest: assetRequest, assetSegment: assetSegment) return } - if let error = error { + if error != nil { segmentRequestDidFail(assetRequest: assetRequest, assetSegment: assetSegment) return } @@ -848,7 +848,7 @@ open class ProxiedContentDownloader: NSObject, URLSessionTaskDelegate, URLSessio // Don't back up ProxiedContent downloads. OWSFileSystem.protectFileOrFolder(atPath: dirPath) - } catch let error as NSError { + } catch { downloadFolderPath = tempDirPath } }