Fix a few build warnings

This commit is contained in:
Max Radermacher 2024-04-17 19:11:13 -05:00 committed by GitHub
parent 518398e2cd
commit a241f40621
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 21 additions and 24 deletions

View File

@ -302,7 +302,7 @@ public class CVComponentGenericAttachment: CVComponentBase, CVComponent {
case .default:
showShareUI(from: componentView.rootView)
}
} else if let attachmentPointer = genericAttachment.attachmentPointer {
} else if genericAttachment.attachmentPointer != nil {
switch genericAttachment.transitTierDownloadState {
case .failed, .pendingMessageRequest, .pendingManualDownload:
guard let message = renderItem.interaction as? TSMessage else {

View File

@ -926,7 +926,7 @@ fileprivate extension CVComponentState.Builder {
var mediaAlbumHasFailedAttachment = false
var mediaAlbumHasPendingAttachment = false
for attachment in bodyAttachments {
guard let attachmentPointer = attachment.attachment.asTransitTierPointer() else {
guard attachment.attachment.asTransitTierPointer() != nil else {
continue
}
switch attachment.attachment.transitTierDownloadState(tx: transaction.asV2Read) {

View File

@ -213,7 +213,7 @@ extension ConversationViewController: ConversationInputToolbarDelegate {
ImpactHapticFeedback.impactOccurred(style: .light)
let message = ThreadUtil.enqueueMessage(withInstalledSticker: stickerInfo, thread: thread)
ThreadUtil.enqueueMessage(withInstalledSticker: stickerInfo, thread: thread)
messageWasSent()
}

View File

@ -2973,7 +2973,6 @@ public class RegistrationCoordinatorImpl: RegistrationCoordinator {
private func restoreFromStorageService(
accountIdentity: AccountIdentity
) -> Guarantee<RegistrationStep> {
let authedDevice = accountIdentity.authedDevice
return deps
.storageServiceManager.restoreOrCreateManifestIfNecessary(
authedDevice: accountIdentity.authedDevice

View File

@ -270,7 +270,7 @@ class BadgeGiftingConfirmationViewController: OWSTableViewController2 {
}))
let messageTextSection = OWSTableSection()
messageTextSection.add(self.textViewItem(self.messageTextView, minimumHeight: 102))
messageTextSection.add(self.textViewItem(messageTextView, minimumHeight: 102))
var sections: [OWSTableSection] = [
badgeSection,

View File

@ -19,7 +19,6 @@ extension ThreadSwipeHandler where Self: UIViewController {
return nil
}
let thread = threadViewModel.threadRecord
let isThreadPinned = threadViewModel.isPinned
let pinnedStateAction: UIContextualAction
if isThreadPinned {

View File

@ -172,7 +172,7 @@ public extension JobQueue {
} catch JobError.permanentFailure(let description) {
owsFailDebug("permanent failure: \(description)")
nextJob.saveAsPermanentlyFailed(transaction: transaction)
} catch JobError.obsolete(let description) {
} catch JobError.obsolete {
// TODO is this even worthwhile to have obsolete state? Should we just delete the task outright?
nextJob.saveAsObsolete(transaction: transaction)
} catch {

View File

@ -460,7 +460,7 @@ public class EditableMessageBodyTextStorage: NSTextStorage {
}
let newStyle = NSRangedValue<SingleStyle>(style, range: range)
let overlaps = NSRangedValue<Any>.overlaps(
let overlaps = NSRangedValue<SingleStyle>.overlaps(
of: newStyle,
in: self.body.flattenedStyles,
isEqual: ==

View File

@ -40,7 +40,7 @@ extension NSRangedValue {
/// definition of equal.
/// The array is assumed to contain no overlaps between "equal" elements; if there are
/// the results of this method are undetermined.
static func overlaps<T>(
static func overlaps(
of range: NSRangedValue<T>,
in array: [NSRangedValue<T>],
isEqual: (T, T) -> Bool

View File

@ -587,7 +587,6 @@ private class MessageAckOperation: OWSOperation {
return
}
let envelopeInfo = self.envelopeInfo
let inFlightAckId = self.inFlightAckId
firstly(on: DispatchQueue.global()) {
self.networkManager.makePromise(request: request)

View File

@ -4,6 +4,7 @@
//
import Foundation
import SignalCoreKit
public protocol MessageStickerManager {
@ -125,7 +126,7 @@ public class MessageStickerManagerImpl: MessageStickerManager {
owsFailDebug("Missing data for installed sticker.")
return nil
}
guard let fileSize = OWSFileSystem.fileSize(of: stickerDataUrl) else {
guard OWSFileSystem.fileSize(of: stickerDataUrl) != nil else {
owsFailDebug("Could not determine file size for installed sticker.")
return nil
}

View File

@ -371,8 +371,6 @@ internal class GroupsMessageProcessor: MessageProcessingPipelineStage, Dependenc
let processedUniqueIds = processedJobs.map { $0.uniqueId }
self.finder.removeJobs(withUniqueIds: processedUniqueIds, transaction: transaction.unwrapGrdbWrite)
let jobCount: UInt = self.finder.jobCount(forGroupId: self.groupId, transaction: transaction.unwrapGrdbRead)
transaction.addAsyncCompletionOffMain {
assert(backgroundTask != nil)
backgroundTask = nil

View File

@ -392,7 +392,7 @@ public extension DatabaseRecovery {
Logger.info("Replacing old database with the new one...")
let newDatabaseFileUrl = try FileManager.default.replaceItemAt(
_ = try FileManager.default.replaceItemAt(
oldDatabaseStorage.databaseFileUrl,
withItemAt: newDatabaseStorage.databaseFileUrl
)

View File

@ -321,14 +321,17 @@ extension PaymentsProcessor: PaymentProcessingOperationDelegate {
processingQueue(forPaymentModel: paymentModel).addOperation(operation)
}
func scheduleRetryProcessing(paymentModel: TSPaymentModel,
retryDelayInteral: TimeInterval,
nextRetryDelayInteral: TimeInterval) {
let paymentId = paymentModel.uniqueId
add(retryScheduler: RetryScheduler(paymentModel: paymentModel,
retryDelayInteral: retryDelayInteral,
nextRetryDelayInteral: nextRetryDelayInteral,
delegate: self))
func scheduleRetryProcessing(
paymentModel: TSPaymentModel,
retryDelayInteral: TimeInterval,
nextRetryDelayInteral: TimeInterval
) {
add(retryScheduler: RetryScheduler(
paymentModel: paymentModel,
retryDelayInteral: retryDelayInteral,
nextRetryDelayInteral: nextRetryDelayInteral,
delegate: self
))
}
func endProcessing(paymentModel: TSPaymentModel) {
@ -608,8 +611,6 @@ private class PaymentProcessingOperation: OWSOperation {
owsAssertDebug(paymentModel.isValid)
let paymentId = paymentModel.uniqueId
switch paymentModel.paymentState {
case .outgoingUnsubmitted:
return self.submitOutgoingPayment(paymentModel: paymentModel)