diff --git a/Signal/src/ViewControllers/DebugUI/DebugUIMessagesAssetLoader.m b/Signal/src/ViewControllers/DebugUI/DebugUIMessagesAssetLoader.m index ce959d113..2d7240764 100644 --- a/Signal/src/ViewControllers/DebugUI/DebugUIMessagesAssetLoader.m +++ b/Signal/src/ViewControllers/DebugUI/DebugUIMessagesAssetLoader.m @@ -371,7 +371,7 @@ NS_ASSUME_NONNULL_BEGIN dispatch_once(&onceToken, ^{ instance = [DebugUIMessagesAssetLoader fakeAssetLoaderWithUrl:@"https://s3.amazonaws.com/ows-data/example_attachment_media/random-jpg.JPG" - mimeType:@"image/jpeg"]; + mimeType:OWSMimeTypeImageJpeg]; }); return instance; } diff --git a/SignalServiceKit/src/Messages/Attachments/TSAttachmentStream.m b/SignalServiceKit/src/Messages/Attachments/TSAttachmentStream.m index fdddb64d0..1797b3215 100644 --- a/SignalServiceKit/src/Messages/Attachments/TSAttachmentStream.m +++ b/SignalServiceKit/src/Messages/Attachments/TSAttachmentStream.m @@ -688,7 +688,7 @@ NS_ASSUME_NONNULL_BEGIN // Copy the thumbnail to a new attachment. NSString *thumbnailName = [NSString stringWithFormat:@"quoted-thumbnail-%@", self.sourceFilename]; TSAttachmentStream *thumbnailAttachment = - [[TSAttachmentStream alloc] initWithContentType:@"image/jpeg" + [[TSAttachmentStream alloc] initWithContentType:OWSMimeTypeImageJpeg byteCount:(uint32_t)thumbnailData.length sourceFilename:thumbnailName]; diff --git a/SignalServiceKit/src/Messages/OWSMessageSender.m b/SignalServiceKit/src/Messages/OWSMessageSender.m index 5e9afd799..ff0b1cd83 100644 --- a/SignalServiceKit/src/Messages/OWSMessageSender.m +++ b/SignalServiceKit/src/Messages/OWSMessageSender.m @@ -5,12 +5,9 @@ #import "OWSMessageSender.h" #import "AppContext.h" #import "ContactsUpdater.h" -#import "Cryptography.h" -#import "MIMETypeUtil.h" #import "NSData+keyVersionByte.h" #import "NSData+messagePadding.h" #import "NSError+MessageSending.h" -#import "NSNotificationCenter+OWS.h" #import "OWSBackgroundTask.h" #import "OWSBlockingManager.h" #import "OWSDevice.h" @@ -41,7 +38,6 @@ #import "TSPreKeyManager.h" #import "TSQuotedMessage.h" #import "TSThread.h" -#import "TextSecureKitEnv.h" #import "Threading.h" #import #import diff --git a/SignalServiceKit/src/Network/API/OWSUploadOperation.m b/SignalServiceKit/src/Network/API/OWSUploadOperation.m index 58a649987..1789f2aeb 100644 --- a/SignalServiceKit/src/Network/API/OWSUploadOperation.m +++ b/SignalServiceKit/src/Network/API/OWSUploadOperation.m @@ -181,7 +181,6 @@ static const CGFloat kAttachmentUploadProgressTheta = 0.001f; }]; } - @end NS_ASSUME_NONNULL_END diff --git a/SignalServiceKit/src/Util/OWSOperation.h b/SignalServiceKit/src/Util/OWSOperation.h index 66b3dcaf6..102f46631 100644 --- a/SignalServiceKit/src/Util/OWSOperation.h +++ b/SignalServiceKit/src/Util/OWSOperation.h @@ -45,17 +45,18 @@ typedef NS_ENUM(NSInteger, OWSOperationState) { // Complete the operation successfully. // Should be called at most once per operation instance. +// You must ensure that `run` cannot fail after calling `reportSuccess`. - (void)reportSuccess; -// To avoid retry, report an error with `error.isFatal = YES` -// otherwise the operation will retry if possible. -// Should be called at most once per `run`, and you should -// ensure that `run` cannot succeed after calling `reportError` -// e.g. generally: +// Should be called at most once per `run`. +// You must ensure that `run` cannot succeed after calling `reportError`, e.g. generally you'll write something like +// this: // // [self reportError:someError]; // return; // +// If the error is terminal, and you want to avoid retry, report an error with `error.isFatal = YES` otherwise the +// operation will retry if possible. - (void)reportError:(NSError *)error; @end