From dc4e174e867b6e056a731de9071ff1e3795fe55d Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Thu, 28 Feb 2019 15:31:35 -0500 Subject: [PATCH] Clean up ahead of PR. --- .../Cells/ConversationMediaView.swift | 4 +-- .../ConversationViewController.m | 28 ------------------- .../HomeView/HomeViewController.m | 6 ---- .../OWSViewController+ImageEditor.swift | 6 ++-- 4 files changed, 5 insertions(+), 39 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/ConversationMediaView.swift b/Signal/src/ViewControllers/ConversationView/Cells/ConversationMediaView.swift index 05ad14a1e..458517b48 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/ConversationMediaView.swift +++ b/Signal/src/ViewControllers/ConversationView/Cells/ConversationMediaView.swift @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // import Foundation @@ -135,7 +135,7 @@ public class ConversationMediaView: UIView { } else if attachmentStream.isVideo { configureForVideo(attachmentStream: attachmentStream) } else { - owsFailDebug("Attachment has unexpected type.") +// owsFailDebug("Attachment has unexpected type.") configure(forError: .invalid) } } diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index ce8f355a7..022f6af4e 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -1269,34 +1269,6 @@ typedef enum : NSUInteger { self.actionOnOpen = ConversationViewActionNone; [self updateInputToolbarLayout]; - - dispatch_async(dispatch_get_main_queue(), ^{ - ConversationMediaAlbumItem *_Nullable firstMediaAlbumItem; - for (id item in self.viewItems) { - if (item.mediaAlbumItems.count < 1) { - continue; - } - ConversationMediaAlbumItem *mediaAlbumItem = item.mediaAlbumItems[0]; - if (mediaAlbumItem.attachmentStream && mediaAlbumItem.attachmentStream.isImage) { - firstMediaAlbumItem = mediaAlbumItem; - break; - } - } - if (!firstMediaAlbumItem) { - return; - } - DataSource *_Nullable dataSource = - [DataSourcePath dataSourceWithURL:firstMediaAlbumItem.attachmentStream.originalMediaURL - shouldDeleteOnDeallocation:NO]; - if (!dataSource) { - OWSFailDebug(@"attachment data was unexpectedly empty for picked document"); - return; - } - NSString *utiType = [MIMETypeUtil utiTypeForMIMEType:firstMediaAlbumItem.attachmentStream.contentType]; - SignalAttachment *attachment = - [SignalAttachment attachmentWithDataSource:dataSource dataUTI:utiType imageQuality:TSImageQualityOriginal]; - [self showApprovalDialogForAttachment: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 f6b3f2ed7..96125433d 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewController.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewController.m @@ -672,12 +672,6 @@ typedef NS_ENUM(NSInteger, HomeViewControllerSection) { [self.searchResultsController viewDidAppear:animated]; self.hasEverAppeared = YES; - - dispatch_async(dispatch_get_main_queue(), ^{ - TSThread *thread = - [self threadForIndexPath:[NSIndexPath indexPathForRow:0 inSection:HomeViewControllerSectionConversations]]; - [self presentThread:thread action:ConversationViewActionNone animated:YES]; - }); } - (void)viewDidDisappear:(BOOL)animated diff --git a/SignalMessaging/Views/ImageEditor/OWSViewController+ImageEditor.swift b/SignalMessaging/Views/ImageEditor/OWSViewController+ImageEditor.swift index 1df368d28..7c2e46b11 100644 --- a/SignalMessaging/Views/ImageEditor/OWSViewController+ImageEditor.swift +++ b/SignalMessaging/Views/ImageEditor/OWSViewController+ImageEditor.swift @@ -12,9 +12,9 @@ public extension NSObject { button.setImage(imageName: imageName) button.tintColor = .white button.addTarget(self, action: selector, for: .touchUpInside) - // button.layer.shadowColor = UIColor.black.cgColor - // button.layer.shadowRadius = 4 - // button.layer.shadowOpacity = 0.66 + button.layer.shadowColor = UIColor.black.cgColor + button.layer.shadowRadius = 2 + button.layer.shadowOpacity = 0.66 return button } }