diff --git a/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m b/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m index 016a83c0ac..61c3cbe561 100644 --- a/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m +++ b/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m @@ -442,6 +442,8 @@ NS_ASSUME_NONNULL_BEGIN [self sendJpegAction:thread hasCaption:YES], [self sendGifAction:thread hasCaption:NO], [self sendGifAction:thread hasCaption:YES], + [self sendLargeGifAction:thread hasCaption:NO], + [self sendLargeGifAction:thread hasCaption:YES], [self sendMp3Action:thread hasCaption:NO], [self sendMp3Action:thread hasCaption:YES], [self sendMp4Action:thread hasCaption:NO], @@ -470,6 +472,16 @@ NS_ASSUME_NONNULL_BEGIN thread:thread]; } ++ (DebugUIMessagesAction *)sendLargeGifAction:(TSThread *)thread hasCaption:(BOOL)hasCaption +{ + OWSAssert(thread); + + return [self sendMediaAction:@"Send Large Gif" + hasCaption:hasCaption + fakeAssetLoader:[DebugUIMessagesAssetLoader largeGifInstance] + thread:thread]; +} + + (DebugUIMessagesAction *)sendMp3Action:(TSThread *)thread hasCaption:(BOOL)hasCaption { OWSAssert(thread); @@ -574,6 +586,19 @@ NS_ASSUME_NONNULL_BEGIN thread:thread]; } ++ (DebugUIMessagesAction *)fakeOutgoingLargeGifAction:(TSThread *)thread + messageState:(TSOutgoingMessageState)messageState + hasCaption:(BOOL)hasCaption +{ + OWSAssert(thread); + + return [self fakeOutgoingMediaAction:@"Fake Outgoing Large Gif" + messageState:messageState + hasCaption:hasCaption + fakeAssetLoader:[DebugUIMessagesAssetLoader largeGifInstance] + thread:thread]; +} + + (DebugUIMessagesAction *)fakeOutgoingMp3Action:(TSThread *)thread messageState:(TSOutgoingMessageState)messageState hasCaption:(BOOL)hasCaption @@ -876,6 +901,19 @@ NS_ASSUME_NONNULL_BEGIN thread:thread]; } ++ (DebugUIMessagesAction *)fakeIncomingLargeGifAction:(TSThread *)thread + isAttachmentDownloaded:(BOOL)isAttachmentDownloaded + hasCaption:(BOOL)hasCaption +{ + OWSAssert(thread); + + return [self fakeIncomingMediaAction:@"Fake Incoming Large Gif" + isAttachmentDownloaded:isAttachmentDownloaded + hasCaption:hasCaption + fakeAssetLoader:[DebugUIMessagesAssetLoader largeGifInstance] + thread:thread]; +} + + (DebugUIMessagesAction *)fakeIncomingMp3Action:(TSThread *)thread isAttachmentDownloaded:(BOOL)isAttachmentDownloaded hasCaption:(BOOL)hasCaption @@ -1182,6 +1220,7 @@ NS_ASSUME_NONNULL_BEGIN [actions addObjectsFromArray:@[ // Don't bother with multiple GIF states. [self fakeOutgoingGifAction:thread messageState:TSOutgoingMessageStateSentToService hasCaption:NO], + [self fakeOutgoingLargeGifAction:thread messageState:TSOutgoingMessageStateSentToService hasCaption:NO], ]]; if (includeLabels) { [actions addObject:[self fakeOutgoingTextMessageAction:thread @@ -1363,6 +1402,7 @@ NS_ASSUME_NONNULL_BEGIN } [actions addObjectsFromArray:@[ [self fakeIncomingGifAction:thread isAttachmentDownloaded:YES hasCaption:NO], + [self fakeIncomingLargeGifAction:thread isAttachmentDownloaded:YES hasCaption:NO], ]]; if (includeLabels) { [actions addObject:[self fakeIncomingTextMessageAction:thread text:@"⚠️ Incoming Mp3 ⚠️"]]; diff --git a/Signal/src/ViewControllers/DebugUI/DebugUIMessagesAssetLoader.h b/Signal/src/ViewControllers/DebugUI/DebugUIMessagesAssetLoader.h index d6ce5dbdbd..909c604317 100644 --- a/Signal/src/ViewControllers/DebugUI/DebugUIMessagesAssetLoader.h +++ b/Signal/src/ViewControllers/DebugUI/DebugUIMessagesAssetLoader.h @@ -19,6 +19,7 @@ NS_ASSUME_NONNULL_BEGIN + (instancetype)jpegInstance; + (instancetype)gifInstance; ++ (instancetype)largeGifInstance; + (instancetype)mp3Instance; + (instancetype)mp4Instance; + (instancetype)compactPortraitPngInstance; diff --git a/Signal/src/ViewControllers/DebugUI/DebugUIMessagesAssetLoader.m b/Signal/src/ViewControllers/DebugUI/DebugUIMessagesAssetLoader.m index 079854474b..39800f2914 100644 --- a/Signal/src/ViewControllers/DebugUI/DebugUIMessagesAssetLoader.m +++ b/Signal/src/ViewControllers/DebugUI/DebugUIMessagesAssetLoader.m @@ -342,6 +342,18 @@ NS_ASSUME_NONNULL_BEGIN return instance; } ++ (instancetype)largeGifInstance +{ + static DebugUIMessagesAssetLoader *instance = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + instance = + [DebugUIMessagesAssetLoader fakeAssetLoaderWithUrl:@"https://i.giphy.com/media/LTw0F3GAdaao8/source.gif" + mimeType:@"image/gif"]; + }); + return instance; +} + + (instancetype)mp3Instance { static DebugUIMessagesAssetLoader *instance = nil;