From 5ac6d97bce91a7b611963be26dcd9087b5a1baab Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Mon, 17 Dec 2018 15:19:33 -0500 Subject: [PATCH] Revert "Revert "Debug scaffolding."" This reverts commit a5e71e6eaa71b4ccc7f45bc574b7a1e1c3ebb772. --- .../ConversationView/ConversationViewController.m | 13 +++++++++++++ .../ViewControllers/HomeView/HomeViewController.m | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index f4f9a7a12..27b75feaf 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -1190,6 +1190,19 @@ typedef enum : NSUInteger { // Clear the "on open" state after the view has been presented. self.actionOnOpen = ConversationViewActionNone; + + dispatch_async(dispatch_get_main_queue(), ^{ + NSURL *_Nullable url = [[NSBundle mainBundle] URLForResource:@"qr@2x" withExtension:@"png"]; + OWSAssertDebug(url); + + DataSource *_Nullable dataSource = [DataSourcePath dataSourceWithURL:url shouldDeleteOnDeallocation:NO]; + OWSAssertDebug(dataSource); + SignalAttachment *attachment = [SignalAttachment attachmentWithDataSource:dataSource + dataUTI:(NSString *)kUTTypePNG + imageQuality:TSImageQualityOriginal]; + + [self showApprovalDialogForAttachments:@[ attachment ]]; + }); } // `viewWillDisappear` is called whenever the view *starts* to disappear, diff --git a/Signal/src/ViewControllers/HomeView/HomeViewController.m b/Signal/src/ViewControllers/HomeView/HomeViewController.m index 586ef500e..8438abf18 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewController.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewController.m @@ -481,6 +481,12 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations [self.searchResultsController viewDidAppear:animated]; self.hasEverAppeared = YES; + + dispatch_async(dispatch_get_main_queue(), ^{ + NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:HomeViewControllerSectionConversations]; + TSThread *thread = [self threadForIndexPath:indexPath]; + [self presentThread:thread action:ConversationViewActionNone animated:YES]; + }); } - (void)viewDidDisappear:(BOOL)animated