Rename home view.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent fd4f00fa4d
commit 928525c31e

@ -70,7 +70,7 @@
34B3F8911E8DF1710035BE1A /* ShowGroupMembersViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F86B1E8DF1700035BE1A /* ShowGroupMembersViewController.m */; }; 34B3F8911E8DF1710035BE1A /* ShowGroupMembersViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F86B1E8DF1700035BE1A /* ShowGroupMembersViewController.m */; };
34B3F8921E8DF1710035BE1A /* SignalAttachment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F86C1E8DF1700035BE1A /* SignalAttachment.swift */; }; 34B3F8921E8DF1710035BE1A /* SignalAttachment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F86C1E8DF1700035BE1A /* SignalAttachment.swift */; };
34B3F8931E8DF1710035BE1A /* SignalsNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F86E1E8DF1700035BE1A /* SignalsNavigationController.m */; }; 34B3F8931E8DF1710035BE1A /* SignalsNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F86E1E8DF1700035BE1A /* SignalsNavigationController.m */; };
34B3F8941E8DF1710035BE1A /* SignalsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8701E8DF1700035BE1A /* SignalsViewController.m */; }; 34B3F8941E8DF1710035BE1A /* HomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8701E8DF1700035BE1A /* HomeViewController.m */; };
34B3F8991E8DF1B90035BE1A /* TSMessageAdapterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8981E8DF1B90035BE1A /* TSMessageAdapterTest.m */; }; 34B3F8991E8DF1B90035BE1A /* TSMessageAdapterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8981E8DF1B90035BE1A /* TSMessageAdapterTest.m */; };
34B3F89C1E8DF3270035BE1A /* BlockListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F89B1E8DF3270035BE1A /* BlockListViewController.m */; }; 34B3F89C1E8DF3270035BE1A /* BlockListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F89B1E8DF3270035BE1A /* BlockListViewController.m */; };
34B3F89F1E8DF5490035BE1A /* OWSTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F89E1E8DF5490035BE1A /* OWSTableViewController.m */; }; 34B3F89F1E8DF5490035BE1A /* OWSTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F89E1E8DF5490035BE1A /* OWSTableViewController.m */; };
@ -510,8 +510,8 @@
34B3F86C1E8DF1700035BE1A /* SignalAttachment.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SignalAttachment.swift; sourceTree = "<group>"; }; 34B3F86C1E8DF1700035BE1A /* SignalAttachment.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SignalAttachment.swift; sourceTree = "<group>"; };
34B3F86D1E8DF1700035BE1A /* SignalsNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SignalsNavigationController.h; sourceTree = "<group>"; }; 34B3F86D1E8DF1700035BE1A /* SignalsNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SignalsNavigationController.h; sourceTree = "<group>"; };
34B3F86E1E8DF1700035BE1A /* SignalsNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SignalsNavigationController.m; sourceTree = "<group>"; }; 34B3F86E1E8DF1700035BE1A /* SignalsNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SignalsNavigationController.m; sourceTree = "<group>"; };
34B3F86F1E8DF1700035BE1A /* SignalsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SignalsViewController.h; sourceTree = "<group>"; }; 34B3F86F1E8DF1700035BE1A /* HomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeViewController.h; sourceTree = "<group>"; };
34B3F8701E8DF1700035BE1A /* SignalsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SignalsViewController.m; sourceTree = "<group>"; }; 34B3F8701E8DF1700035BE1A /* HomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeViewController.m; sourceTree = "<group>"; };
34B3F8981E8DF1B90035BE1A /* TSMessageAdapterTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSMessageAdapterTest.m; sourceTree = "<group>"; }; 34B3F8981E8DF1B90035BE1A /* TSMessageAdapterTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSMessageAdapterTest.m; sourceTree = "<group>"; };
34B3F89A1E8DF3270035BE1A /* BlockListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockListViewController.h; sourceTree = "<group>"; }; 34B3F89A1E8DF3270035BE1A /* BlockListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockListViewController.h; sourceTree = "<group>"; };
34B3F89B1E8DF3270035BE1A /* BlockListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BlockListViewController.m; sourceTree = "<group>"; }; 34B3F89B1E8DF3270035BE1A /* BlockListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BlockListViewController.m; sourceTree = "<group>"; };
@ -1022,6 +1022,8 @@
34E8BF371EE9E2FD00F5F4CA /* FingerprintViewScanController.m */, 34E8BF371EE9E2FD00F5F4CA /* FingerprintViewScanController.m */,
34B3F8471E8DF1700035BE1A /* FullImageViewController.h */, 34B3F8471E8DF1700035BE1A /* FullImageViewController.h */,
34B3F8481E8DF1700035BE1A /* FullImageViewController.m */, 34B3F8481E8DF1700035BE1A /* FullImageViewController.m */,
34B3F86F1E8DF1700035BE1A /* HomeViewController.h */,
34B3F8701E8DF1700035BE1A /* HomeViewController.m */,
34B3F8491E8DF1700035BE1A /* InboxTableViewCell.h */, 34B3F8491E8DF1700035BE1A /* InboxTableViewCell.h */,
34B3F84A1E8DF1700035BE1A /* InboxTableViewCell.m */, 34B3F84A1E8DF1700035BE1A /* InboxTableViewCell.m */,
34B3F84C1E8DF1700035BE1A /* InviteFlow.swift */, 34B3F84C1E8DF1700035BE1A /* InviteFlow.swift */,
@ -1078,8 +1080,6 @@
34B3F86C1E8DF1700035BE1A /* SignalAttachment.swift */, 34B3F86C1E8DF1700035BE1A /* SignalAttachment.swift */,
34B3F86D1E8DF1700035BE1A /* SignalsNavigationController.h */, 34B3F86D1E8DF1700035BE1A /* SignalsNavigationController.h */,
34B3F86E1E8DF1700035BE1A /* SignalsNavigationController.m */, 34B3F86E1E8DF1700035BE1A /* SignalsNavigationController.m */,
34B3F86F1E8DF1700035BE1A /* SignalsViewController.h */,
34B3F8701E8DF1700035BE1A /* SignalsViewController.m */,
3400C7971EAFB772008A8584 /* ThreadViewHelper.h */, 3400C7971EAFB772008A8584 /* ThreadViewHelper.h */,
3400C7981EAFB772008A8584 /* ThreadViewHelper.m */, 3400C7981EAFB772008A8584 /* ThreadViewHelper.m */,
340CB2251EAC25820001CAA1 /* UpdateGroupViewController.h */, 340CB2251EAC25820001CAA1 /* UpdateGroupViewController.h */,
@ -2388,7 +2388,7 @@
4579431E1E7C8CE9008ED0C0 /* Pastelog.m in Sources */, 4579431E1E7C8CE9008ED0C0 /* Pastelog.m in Sources */,
34D99C941F2937CC00D284D6 /* OWSSwiftUtils.swift in Sources */, 34D99C941F2937CC00D284D6 /* OWSSwiftUtils.swift in Sources */,
34C42D661F4734ED0072EC04 /* OWSContactOffersInteraction.m in Sources */, 34C42D661F4734ED0072EC04 /* OWSContactOffersInteraction.m in Sources */,
34B3F8941E8DF1710035BE1A /* SignalsViewController.m in Sources */, 34B3F8941E8DF1710035BE1A /* HomeViewController.m in Sources */,
34E8BF381EE9E2FD00F5F4CA /* FingerprintViewScanController.m in Sources */, 34E8BF381EE9E2FD00F5F4CA /* FingerprintViewScanController.m in Sources */,
346B66311F4E29B200E5122F /* CropScaleImageViewController.swift in Sources */, 346B66311F4E29B200E5122F /* CropScaleImageViewController.swift in Sources */,
76EB058818170B33006006FC /* PropertyListPreferences.m in Sources */, 76EB058818170B33006006FC /* PropertyListPreferences.m in Sources */,

@ -4,7 +4,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "SignalsViewController.h" #import "HomeViewController.h"
extern NSString *const AppDelegateStoryboardMain; extern NSString *const AppDelegateStoryboardMain;

@ -801,7 +801,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
DDLogInfo(@"Presenting initial root view controller"); DDLogInfo(@"Presenting initial root view controller");
if ([TSAccountManager isRegistered]) { if ([TSAccountManager isRegistered]) {
SignalsViewController *homeView = [SignalsViewController new]; HomeViewController *homeView = [HomeViewController new];
SignalsNavigationController *navigationController = SignalsNavigationController *navigationController =
[[SignalsNavigationController alloc] initWithRootViewController:homeView]; [[SignalsNavigationController alloc] initWithRootViewController:homeView];
self.window.rootViewController = navigationController; self.window.rootViewController = navigationController;

@ -10,6 +10,7 @@
#import "Environment.h" #import "Environment.h"
#import "FLAnimatedImage.h" #import "FLAnimatedImage.h"
#import "FingerprintViewController.h" #import "FingerprintViewController.h"
#import "HomeViewController.h"
#import "NotificationsManager.h" #import "NotificationsManager.h"
#import "OWSAnyTouchGestureRecognizer.h" #import "OWSAnyTouchGestureRecognizer.h"
#import "OWSAudioAttachmentPlayer.h" #import "OWSAudioAttachmentPlayer.h"
@ -29,7 +30,6 @@
#import "PropertyListPreferences.h" #import "PropertyListPreferences.h"
#import "PushManager.h" #import "PushManager.h"
#import "Release.h" #import "Release.h"
#import "SignalsViewController.h"
#import "TSMessageAdapter.h" #import "TSMessageAdapter.h"
#import "UIColor+OWS.h" #import "UIColor+OWS.h"
#import "UIFont+OWS.h" #import "UIFont+OWS.h"

@ -1,65 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12120" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait"> <device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/> <adaptation id="fullscreen"/>
</device> </device>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/> <capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/> <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/> <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--MessagesVC-->
<scene sceneID="QqV-z2-xRW">
<objects>
<viewController storyboardIdentifier="MessagesViewController" title="MessagesVC" hidesBottomBarWhenPushed="YES" id="DtA-8O-wrT" customClass="MessagesViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="0di-ZU-w1m"/>
<viewControllerLayoutGuide type="bottom" id="stV-ob-KSQ"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="5r3-kq-bbI">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<navigationItem key="navigationItem" title="Title" id="mLN-DG-4IU">
<barButtonItem key="backBarButtonItem" title=" " id="wnY-V7-zmi"/>
<barButtonItem key="rightBarButtonItem" image="contact-options-action" id="662-pN-RLf">
<inset key="imageInsets" minX="17" minY="10" maxX="0.0" maxY="5"/>
<color key="tintColor" red="0.99987119436264038" green="0.99998223781585693" blue="0.99984109401702881" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</barButtonItem>
</navigationItem>
<connections>
<outlet property="inputToolbar" destination="BdJ-vY-dHA" id="EfK-zI-nSM"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="yXZ-iE-5va" userLabel="First Responder" sceneMemberID="firstResponder"/>
<toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="BdJ-vY-dHA" customClass="OWSMessagesInputToolbar">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<items>
<barButtonItem title="Item" id="4F3-az-L9s"/>
</items>
</toolbar>
<view contentMode="scaleToFill" id="X6H-b7-xZK" customClass="OWSMessagesToolbarContentView">
<rect key="frame" x="0.0" y="0.0" width="240" height="128"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<outlet property="textView" destination="XUl-oy-JS1" id="kzd-TM-IJT"/>
</connections>
</view>
<view contentMode="scaleToFill" id="XUl-oy-JS1" customClass="JSQMessagesComposerTextView">
<rect key="frame" x="0.0" y="0.0" width="240" height="128"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</objects>
<point key="canvasLocation" x="-2287" y="-1516"/>
</scene>
<!--Linked Devices--> <!--Linked Devices-->
<scene sceneID="R59-ey-Ucx"> <scene sceneID="R59-ey-Ucx">
<objects> <objects>
@ -262,7 +214,6 @@
</scene> </scene>
</scenes> </scenes>
<resources> <resources>
<image name="contact-options-action" width="44" height="44"/>
<image name="ic_devices_ios" width="180" height="119"/> <image name="ic_devices_ios" width="180" height="119"/>
</resources> </resources>
<simulatedMetricsContainer key="defaultSimulatedMetrics"> <simulatedMetricsContainer key="defaultSimulatedMetrics">

@ -669,7 +669,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
[self startExpirationTimerAnimations]; [self startExpirationTimerAnimations];
// We should have already requested contact access at this point, so this should be a no-op // We should have already requested contact access at this point, so this should be a no-op
// unless it ever becomes possible to load this VC without going via the SignalsViewController. // unless it ever becomes possible to load this VC without going via the HomeViewController.
[self.contactsManager requestSystemContactsOnce]; [self.contactsManager requestSystemContactsOnce];
OWSDisappearingMessagesConfiguration *configuration = OWSDisappearingMessagesConfiguration *configuration =

@ -83,7 +83,7 @@ private class IntroductingProfilesExperienceUpgradeViewController: ExperienceUpg
// dismiss the modally presented view controller, then proceed. // dismiss the modally presented view controller, then proceed.
experienceUpgradesPageViewController.dismiss(animated: true) { experienceUpgradesPageViewController.dismiss(animated: true) {
guard let fromViewController = UIApplication.shared.frontmostViewController as? SignalsViewController else { guard let fromViewController = UIApplication.shared.frontmostViewController as? HomeViewController else {
owsFail("unexpected frontmostViewController: \(String(describing: UIApplication.shared.frontmostViewController))") owsFail("unexpected frontmostViewController: \(String(describing: UIApplication.shared.frontmostViewController))")
return return
} }

@ -7,7 +7,7 @@
@class TSThread; @class TSThread;
@interface SignalsViewController : OWSViewController @interface HomeViewController : OWSViewController
// TODO: Remove this property. // TODO: Remove this property.
@property (nonatomic) BOOL newlyRegisteredUser; @property (nonatomic) BOOL newlyRegisteredUser;

@ -2,7 +2,7 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// //
#import "SignalsViewController.h" #import "HomeViewController.h"
#import "AppDelegate.h" #import "AppDelegate.h"
#import "AppSettingsViewController.h" #import "AppSettingsViewController.h"
#import "InboxTableViewCell.h" #import "InboxTableViewCell.h"
@ -34,7 +34,7 @@
typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState }; typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
@interface SignalsViewController () <UITableViewDelegate, UITableViewDataSource, UIViewControllerPreviewingDelegate> @interface HomeViewController () <UITableViewDelegate, UITableViewDataSource, UIViewControllerPreviewingDelegate>
@property (nonatomic) UITableView *tableView; @property (nonatomic) UITableView *tableView;
@property (nonatomic) UILabel *emptyBoxLabel; @property (nonatomic) UILabel *emptyBoxLabel;
@ -74,7 +74,7 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
#pragma mark - #pragma mark -
@implementation SignalsViewController @implementation HomeViewController
#pragma mark - Init #pragma mark - Init
@ -169,7 +169,7 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
self.view.backgroundColor = [UIColor whiteColor]; self.view.backgroundColor = [UIColor whiteColor];
// TODO: Remove this. // TODO: Remove this.
[[Environment getCurrent] setSignalsViewController:self]; [[Environment getCurrent] setHomeViewController:self];
self.navigationItem.rightBarButtonItem = self.navigationItem.rightBarButtonItem =
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose
@ -179,7 +179,7 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
ReminderView *archiveReminderView = [ReminderView new]; ReminderView *archiveReminderView = [ReminderView new];
archiveReminderView.text = NSLocalizedString( archiveReminderView.text = NSLocalizedString(
@"INBOX_VIEW_ARCHIVE_MODE_REMINDER", @"Label reminding the user that they are in archive mode."); @"INBOX_VIEW_ARCHIVE_MODE_REMINDER", @"Label reminding the user that they are in archive mode.");
__weak SignalsViewController *weakSelf = self; __weak HomeViewController *weakSelf = self;
archiveReminderView.tapAction = ^{ archiveReminderView.tapAction = ^{
[weakSelf showInboxGrouping]; [weakSelf showInboxGrouping];
}; };
@ -236,7 +236,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
[self.view layoutSubviews]; [self.view layoutSubviews];
} }
- (void)viewDidLoad { - (void)viewDidLoad
{
[super viewDidLoad]; [super viewDidLoad];
[self.navigationController.navigationBar setTranslucent:NO]; [self.navigationController.navigationBar setTranslucent:NO];
@ -263,18 +264,19 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
UINavigationItem *navigationItem = self.navigationItem; UINavigationItem *navigationItem = self.navigationItem;
navigationItem.titleView = self.segmentedControl; navigationItem.titleView = self.segmentedControl;
[self.segmentedControl setSelectedSegmentIndex:0]; [self.segmentedControl setSelectedSegmentIndex:0];
navigationItem.leftBarButtonItem.accessibilityLabel = NSLocalizedString( navigationItem.leftBarButtonItem.accessibilityLabel
@"SETTINGS_BUTTON_ACCESSIBILITY", @"Accessibility hint for the settings button"); = NSLocalizedString(@"SETTINGS_BUTTON_ACCESSIBILITY", @"Accessibility hint for the settings button");
if ([self.traitCollection respondsToSelector:@selector(forceTouchCapability)] && if ([self.traitCollection respondsToSelector:@selector(forceTouchCapability)]
(self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable)) { && (self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable)) {
[self registerForPreviewingWithDelegate:self sourceView:self.tableView]; [self registerForPreviewingWithDelegate:self sourceView:self.tableView];
} }
[self updateBarButtonItems]; [self updateBarButtonItems];
} }
- (void)updateBarButtonItems { - (void)updateBarButtonItems
{
const CGFloat kBarButtonSize = 44; const CGFloat kBarButtonSize = 44;
// We use UIButtons with [UIBarButtonItem initWithCustomView:...] instead of // We use UIButtons with [UIBarButtonItem initWithCustomView:...] instead of
// UIBarButtonItem in order to ensure that these buttons are spaced tightly. // UIBarButtonItem in order to ensure that these buttons are spaced tightly.
@ -309,14 +311,16 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button]; self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
} }
- (void)settingsButtonPressed:(id)sender { - (void)settingsButtonPressed:(id)sender
{
AppSettingsViewController *vc = [AppSettingsViewController new]; AppSettingsViewController *vc = [AppSettingsViewController new];
OWSNavigationController *navigationController = [[OWSNavigationController alloc] initWithRootViewController:vc]; OWSNavigationController *navigationController = [[OWSNavigationController alloc] initWithRootViewController:vc];
[self presentViewController:navigationController animated:YES completion:nil]; [self presentViewController:navigationController animated:YES completion:nil];
} }
- (UIViewController *)previewingContext:(id<UIViewControllerPreviewing>)previewingContext - (UIViewController *)previewingContext:(id<UIViewControllerPreviewing>)previewingContext
viewControllerForLocation:(CGPoint)location { viewControllerForLocation:(CGPoint)location
{
NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:location]; NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:location];
if (indexPath) { if (indexPath) {
@ -335,7 +339,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
} }
- (void)previewingContext:(id<UIViewControllerPreviewing>)previewingContext - (void)previewingContext:(id<UIViewControllerPreviewing>)previewingContext
commitViewController:(UIViewController *)viewControllerToCommit { commitViewController:(UIViewController *)viewControllerToCommit
{
MessagesViewController *vc = (MessagesViewController *)viewControllerToCommit; MessagesViewController *vc = (MessagesViewController *)viewControllerToCommit;
[vc popped]; [vc popped];
@ -361,7 +366,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
}]; }];
} }
- (void)swappedSegmentedControl { - (void)swappedSegmentedControl
{
if (self.segmentedControl.selectedSegmentIndex == 0) { if (self.segmentedControl.selectedSegmentIndex == 0) {
[self showInboxGrouping]; [self showInboxGrouping];
} else { } else {
@ -369,7 +375,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
} }
} }
- (void)viewWillAppear:(BOOL)animated { - (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated]; [super viewWillAppear:animated];
if ([TSThread numberOfKeysInCollection] > 0) { if ([TSThread numberOfKeysInCollection] > 0) {
[self.contactsManager requestSystemContactsOnceWithCompletion:^(NSError *_Nullable error) { [self.contactsManager requestSystemContactsOnceWithCompletion:^(NSError *_Nullable error) {
@ -482,7 +489,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
self.isAppInBackground = YES; self.isAppInBackground = YES;
} }
- (void)viewDidAppear:(BOOL)animated { - (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated]; [super viewDidAppear:animated];
if (self.newlyRegisteredUser) { if (self.newlyRegisteredUser) {
@ -528,7 +536,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
NSArray<ExperienceUpgrade *> *unseenUpgrades = [self unseenUpgradeExperiences]; NSArray<ExperienceUpgrade *> *unseenUpgrades = [self unseenUpgradeExperiences];
if (unseenUpgrades.count > 0) { if (unseenUpgrades.count > 0) {
ExperienceUpgradesPageViewController *experienceUpgradeViewController = [[ExperienceUpgradesPageViewController alloc] initWithExperienceUpgrades:unseenUpgrades]; ExperienceUpgradesPageViewController *experienceUpgradeViewController =
[[ExperienceUpgradesPageViewController alloc] initWithExperienceUpgrades:unseenUpgrades];
[self presentViewController:experienceUpgradeViewController [self presentViewController:experienceUpgradeViewController
animated:YES animated:YES
completion:^{ completion:^{
@ -541,7 +550,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
self.hasBeenPresented = YES; self.hasBeenPresented = YES;
} }
- (void)tableViewSetUp { - (void)tableViewSetUp
{
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
} }
@ -561,7 +571,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
return (NSInteger)[self.threadMappings numberOfSections]; return (NSInteger)[self.threadMappings numberOfSections];
} }
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return (NSInteger)[self.threadMappings numberOfItemsInSection:(NSUInteger)section]; return (NSInteger)[self.threadMappings numberOfItemsInSection:(NSUInteger)section];
} }
@ -582,7 +593,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
return cell; return cell;
} }
- (TSThread *)threadForIndexPath:(NSIndexPath *)indexPath { - (TSThread *)threadForIndexPath:(NSIndexPath *)indexPath
{
__block TSThread *thread = nil; __block TSThread *thread = nil;
[self.uiDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) { [self.uiDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {
thread = [[transaction extension:TSThreadDatabaseViewExtensionName] objectAtIndexPath:indexPath thread = [[transaction extension:TSThreadDatabaseViewExtensionName] objectAtIndexPath:indexPath
@ -592,7 +604,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
return thread; return thread;
} }
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return InboxTableViewCell.rowHeight; return InboxTableViewCell.rowHeight;
} }
@ -600,12 +613,14 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
- (void)tableView:(UITableView *)tableView - (void)tableView:(UITableView *)tableView
commitEditingStyle:(UITableViewCellEditingStyle)editingStyle commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath:(NSIndexPath *)indexPath { forRowAtIndexPath:(NSIndexPath *)indexPath
{
return; return;
} }
- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath { - (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewRowAction *deleteAction = UITableViewRowAction *deleteAction =
[UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault
title:NSLocalizedString(@"TXT_DELETE_TITLE", nil) title:NSLocalizedString(@"TXT_DELETE_TITLE", nil)
@ -617,7 +632,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
if (self.viewingThreadsIn == kInboxState) { if (self.viewingThreadsIn == kInboxState) {
archiveAction = [UITableViewRowAction archiveAction = [UITableViewRowAction
rowActionWithStyle:UITableViewRowActionStyleNormal rowActionWithStyle:UITableViewRowActionStyleNormal
title:NSLocalizedString(@"ARCHIVE_ACTION", @"Pressing this button moves a thread from the inbox to the archive") title:NSLocalizedString(@"ARCHIVE_ACTION",
@"Pressing this button moves a thread from the inbox to the archive")
handler:^(UITableViewRowAction *_Nonnull action, NSIndexPath *_Nonnull tappedIndexPath) { handler:^(UITableViewRowAction *_Nonnull action, NSIndexPath *_Nonnull tappedIndexPath) {
[self archiveIndexPath:tappedIndexPath]; [self archiveIndexPath:tappedIndexPath];
[Environment.preferences setHasArchivedAMessage:YES]; [Environment.preferences setHasArchivedAMessage:YES];
@ -626,7 +642,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
} else { } else {
archiveAction = [UITableViewRowAction archiveAction = [UITableViewRowAction
rowActionWithStyle:UITableViewRowActionStyleNormal rowActionWithStyle:UITableViewRowActionStyleNormal
title:NSLocalizedString(@"UNARCHIVE_ACTION", @"Pressing this button moves an archived thread from the archive back to the inbox") title:NSLocalizedString(@"UNARCHIVE_ACTION",
@"Pressing this button moves an archived thread from the archive back to the inbox")
handler:^(UITableViewRowAction *_Nonnull action, NSIndexPath *_Nonnull tappedIndexPath) { handler:^(UITableViewRowAction *_Nonnull action, NSIndexPath *_Nonnull tappedIndexPath) {
[self archiveIndexPath:tappedIndexPath]; [self archiveIndexPath:tappedIndexPath];
}]; }];
@ -636,13 +653,15 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
return @[ deleteAction, archiveAction ]; return @[ deleteAction, archiveAction ];
} }
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
return YES; return YES;
} }
#pragma mark - HomeFeedTableViewCellDelegate #pragma mark - HomeFeedTableViewCellDelegate
- (void)tableViewCellTappedDelete:(NSIndexPath *)indexPath { - (void)tableViewCellTappedDelete:(NSIndexPath *)indexPath
{
TSThread *thread = [self threadForIndexPath:indexPath]; TSThread *thread = [self threadForIndexPath:indexPath];
if ([thread isKindOfClass:[TSGroupThread class]]) { if ([thread isKindOfClass:[TSGroupThread class]]) {
@ -683,7 +702,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
} }
} }
- (void)deleteThread:(TSThread *)thread { - (void)deleteThread:(TSThread *)thread
{
[self.editingDbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { [self.editingDbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
[thread removeWithTransaction:transaction]; [thread removeWithTransaction:transaction];
}]; }];
@ -692,7 +712,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
[self checkIfEmptyView]; [self checkIfEmptyView];
} }
- (void)archiveIndexPath:(NSIndexPath *)indexPath { - (void)archiveIndexPath:(NSIndexPath *)indexPath
{
TSThread *thread = [self threadForIndexPath:indexPath]; TSThread *thread = [self threadForIndexPath:indexPath];
BOOL viewingThreadsIn = self.viewingThreadsIn; BOOL viewingThreadsIn = self.viewingThreadsIn;
@ -719,7 +740,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
[_segmentedControl reloadInputViews]; [_segmentedControl reloadInputViews];
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
TSThread *thread = [self threadForIndexPath:indexPath]; TSThread *thread = [self threadForIndexPath:indexPath];
[self presentThread:thread keyboardOnViewAppearing:NO callOnViewAppearing:NO]; [self presentThread:thread keyboardOnViewAppearing:NO callOnViewAppearing:NO];
[tableView deselectRowAtIndexPath:indexPath animated:YES]; [tableView deselectRowAtIndexPath:indexPath animated:YES];
@ -736,8 +758,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
// We do this synchronously if we're already on the main thread. // We do this synchronously if we're already on the main thread.
DispatchMainThreadSafe(^{ DispatchMainThreadSafe(^{
MessagesViewController *mvc = [[MessagesViewController alloc] initWithNibName:@"MessagesViewController" MessagesViewController *mvc =
bundle:nil]; [[MessagesViewController alloc] initWithNibName:@"MessagesViewController" bundle:nil];
[mvc configureForThread:thread [mvc configureForThread:thread
keyboardOnViewAppearing:keyboardOnViewAppearing keyboardOnViewAppearing:keyboardOnViewAppearing
callOnViewAppearing:callOnViewAppearing]; callOnViewAppearing:callOnViewAppearing];
@ -865,7 +887,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
#pragma mark Database delegates #pragma mark Database delegates
- (YapDatabaseConnection *)uiDatabaseConnection { - (YapDatabaseConnection *)uiDatabaseConnection
{
NSAssert([NSThread isMainThread], @"Must access uiDatabaseConnection on main thread!"); NSAssert([NSThread isMainThread], @"Must access uiDatabaseConnection on main thread!");
if (!_uiDatabaseConnection) { if (!_uiDatabaseConnection) {
YapDatabase *database = TSStorageManager.sharedManager.database; YapDatabase *database = TSStorageManager.sharedManager.database;
@ -875,7 +898,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
return _uiDatabaseConnection; return _uiDatabaseConnection;
} }
- (void)yapDatabaseModified:(NSNotification *)notification { - (void)yapDatabaseModified:(NSNotification *)notification
{
if (!self.shouldObserveDBModifications) { if (!self.shouldObserveDBModifications) {
return; return;
} }
@ -964,7 +988,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
[self.tableView endUpdates]; [self.tableView endUpdates];
} }
- (void)checkIfEmptyView { - (void)checkIfEmptyView
{
[_tableView setHidden:NO]; [_tableView setHidden:NO];
[_emptyBoxLabel setHidden:NO]; [_emptyBoxLabel setHidden:NO];
if (self.viewingThreadsIn == kInboxState && [self.threadMappings numberOfItemsInGroup:TSInboxGroup] == 0) { if (self.viewingThreadsIn == kInboxState && [self.threadMappings numberOfItemsInGroup:TSInboxGroup] == 0) {
@ -979,7 +1004,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
} }
} }
- (void)setEmptyBoxText { - (void)setEmptyBoxText
{
_emptyBoxLabel.textColor = [UIColor grayColor]; _emptyBoxLabel.textColor = [UIColor grayColor];
_emptyBoxLabel.font = [UIFont ows_regularFontWithSize:18.f]; _emptyBoxLabel.font = [UIFont ows_regularFontWithSize:18.f];
_emptyBoxLabel.textAlignment = NSTextAlignmentCenter; _emptyBoxLabel.textAlignment = NSTextAlignmentCenter;

@ -4,7 +4,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@class SignalsViewController; @class HomeViewController;
@interface ProfileViewController : UIViewController @interface ProfileViewController : UIViewController
@ -14,8 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
+ (void)presentForAppSettings:(UINavigationController *)navigationController; + (void)presentForAppSettings:(UINavigationController *)navigationController;
+ (void)presentForRegistration:(UINavigationController *)navigationController; + (void)presentForRegistration:(UINavigationController *)navigationController;
+ (void)presentForUpgradeOrNag:(SignalsViewController *)presentingController + (void)presentForUpgradeOrNag:(HomeViewController *)presentingController NS_SWIFT_NAME(presentForUpgradeOrNag(from:));
NS_SWIFT_NAME(presentForUpgradeOrNag(from:));
@end @end

@ -5,11 +5,11 @@
#import "ProfileViewController.h" #import "ProfileViewController.h"
#import "AppDelegate.h" #import "AppDelegate.h"
#import "AvatarViewHelper.h" #import "AvatarViewHelper.h"
#import "HomeViewController.h"
#import "OWSNavigationController.h" #import "OWSNavigationController.h"
#import "OWSProfileManager.h" #import "OWSProfileManager.h"
#import "Signal-Swift.h" #import "Signal-Swift.h"
#import "SignalsNavigationController.h" #import "SignalsNavigationController.h"
#import "SignalsViewController.h"
#import "UIColor+OWS.h" #import "UIColor+OWS.h"
#import "UIFont+OWS.h" #import "UIFont+OWS.h"
#import "UIView+OWS.h" #import "UIView+OWS.h"
@ -434,13 +434,13 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
- (void)showHomeView - (void)showHomeView
{ {
SignalsViewController *homeView = [SignalsViewController new]; HomeViewController *homeView = [HomeViewController new];
homeView.newlyRegisteredUser = YES; homeView.newlyRegisteredUser = YES;
SignalsNavigationController *navigationController = SignalsNavigationController *navigationController =
[[SignalsNavigationController alloc] initWithRootViewController:homeView]; [[SignalsNavigationController alloc] initWithRootViewController:homeView];
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
appDelegate.window.rootViewController = navigationController; appDelegate.window.rootViewController = navigationController;
OWSAssert([navigationController.topViewController isKindOfClass:[SignalsViewController class]]); OWSAssert([navigationController.topViewController isKindOfClass:[HomeViewController class]]);
} }
#pragma mark - UITextFieldDelegate #pragma mark - UITextFieldDelegate
@ -554,7 +554,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
[navigationController pushViewController:vc animated:YES]; [navigationController pushViewController:vc animated:YES];
} }
+ (void)presentForUpgradeOrNag:(SignalsViewController *)presentingController + (void)presentForUpgradeOrNag:(HomeViewController *)presentingController
{ {
OWSAssert(presentingController); OWSAssert(presentingController);

@ -7,8 +7,8 @@
#import "ContactTableViewCell.h" #import "ContactTableViewCell.h"
#import "ContactsViewHelper.h" #import "ContactsViewHelper.h"
#import "Environment.h" #import "Environment.h"
#import "HomeViewController.h"
#import "OWSContactsManager.h" #import "OWSContactsManager.h"
#import "SignalsViewController.h"
#import "Signal-Swift.h" #import "Signal-Swift.h"
#import "UIUtil.h" #import "UIUtil.h"
#import "ViewControllerUtils.h" #import "ViewControllerUtils.h"

@ -4,9 +4,9 @@
#import "ViewControllerUtils.h" #import "ViewControllerUtils.h"
#import "Environment.h" #import "Environment.h"
#import "HomeViewController.h"
#import "PhoneNumber.h" #import "PhoneNumber.h"
#import "Signal-Swift.h" #import "Signal-Swift.h"
#import "SignalsViewController.h"
#import "StringUtil.h" #import "StringUtil.h"
#import <AVFoundation/AVFoundation.h> #import <AVFoundation/AVFoundation.h>
#import <SignalServiceKit/PhoneNumberUtil.h> #import <SignalServiceKit/PhoneNumberUtil.h>

@ -18,7 +18,7 @@
@class UINavigationController; @class UINavigationController;
@class OWSContactsManager; @class OWSContactsManager;
@class OutboundCallInitiator; @class OutboundCallInitiator;
@class SignalsViewController; @class HomeViewController;
@class TSGroupThread; @class TSGroupThread;
@class ContactsUpdater; @class ContactsUpdater;
@class TSNetworkManager; @class TSNetworkManager;
@ -49,7 +49,7 @@
@property (nonatomic, readonly) PropertyListPreferences *preferences; @property (nonatomic, readonly) PropertyListPreferences *preferences;
@property (nonatomic, readonly) SignalsViewController *signalsViewController; @property (nonatomic, readonly) HomeViewController *signalsViewController;
@property (nonatomic, readonly, weak) UINavigationController *signUpFlowNavigationController; @property (nonatomic, readonly, weak) UINavigationController *signUpFlowNavigationController;
+ (Environment *)getCurrent; + (Environment *)getCurrent;
@ -59,7 +59,7 @@
+ (void)resetAppData; + (void)resetAppData;
- (void)setSignalsViewController:(SignalsViewController *)signalsViewController; - (void)setHomeViewController:(HomeViewController *)signalsViewController;
- (void)setSignUpFlowNavigationController:(UINavigationController *)signUpFlowNavigationController; - (void)setSignUpFlowNavigationController:(UINavigationController *)signUpFlowNavigationController;
+ (void)messageThreadId:(NSString *)threadId; + (void)messageThreadId:(NSString *)threadId;

@ -5,10 +5,10 @@
#import "Environment.h" #import "Environment.h"
#import "DebugLogger.h" #import "DebugLogger.h"
#import "FunctionalUtil.h" #import "FunctionalUtil.h"
#import "HomeViewController.h"
#import "MessagesViewController.h" #import "MessagesViewController.h"
#import "Signal-Swift.h" #import "Signal-Swift.h"
#import "SignalKeyingStorage.h" #import "SignalKeyingStorage.h"
#import "SignalsViewController.h"
#import "TSContactThread.h" #import "TSContactThread.h"
#import "TSGroupThread.h" #import "TSGroupThread.h"
#import <SignalServiceKit/ContactsUpdater.h> #import <SignalServiceKit/ContactsUpdater.h>
@ -171,7 +171,8 @@ static Environment *environment = nil;
return _preferences; return _preferences;
} }
- (void)setSignalsViewController:(SignalsViewController *)signalsViewController { - (void)setHomeViewController:(HomeViewController *)signalsViewController
{
_signalsViewController = signalsViewController; _signalsViewController = signalsViewController;
} }
@ -191,7 +192,7 @@ static Environment *environment = nil;
[self messageGroup:(TSGroupThread *)thread]; [self messageGroup:(TSGroupThread *)thread];
} else { } else {
Environment *env = [self getCurrent]; Environment *env = [self getCurrent];
SignalsViewController *vc = env.signalsViewController; HomeViewController *vc = env.signalsViewController;
UIViewController *topvc = vc.navigationController.topViewController; UIViewController *topvc = vc.navigationController.topViewController;
if ([topvc isKindOfClass:[MessagesViewController class]]) { if ([topvc isKindOfClass:[MessagesViewController class]]) {
@ -207,7 +208,7 @@ static Environment *environment = nil;
+ (void)messageIdentifier:(NSString *)identifier withCompose:(BOOL)compose { + (void)messageIdentifier:(NSString *)identifier withCompose:(BOOL)compose {
Environment *env = [self getCurrent]; Environment *env = [self getCurrent];
SignalsViewController *vc = env.signalsViewController; HomeViewController *vc = env.signalsViewController;
[[TSStorageManager sharedManager].dbReadWriteConnection [[TSStorageManager sharedManager].dbReadWriteConnection
asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *_Nonnull transaction) { asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *_Nonnull transaction) {
@ -219,7 +220,7 @@ static Environment *environment = nil;
+ (void)callUserWithIdentifier:(NSString *)identifier + (void)callUserWithIdentifier:(NSString *)identifier
{ {
Environment *env = [self getCurrent]; Environment *env = [self getCurrent];
SignalsViewController *vc = env.signalsViewController; HomeViewController *vc = env.signalsViewController;
[[TSStorageManager sharedManager].dbReadWriteConnection [[TSStorageManager sharedManager].dbReadWriteConnection
asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *_Nonnull transaction) { asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *_Nonnull transaction) {
@ -230,7 +231,7 @@ static Environment *environment = nil;
+ (void)messageGroup:(TSGroupThread *)groupThread { + (void)messageGroup:(TSGroupThread *)groupThread {
Environment *env = [self getCurrent]; Environment *env = [self getCurrent];
SignalsViewController *vc = env.signalsViewController; HomeViewController *vc = env.signalsViewController;
[vc presentThread:groupThread keyboardOnViewAppearing:YES callOnViewAppearing:NO]; [vc presentThread:groupThread keyboardOnViewAppearing:YES callOnViewAppearing:NO];
} }

@ -63,7 +63,7 @@ NSString *const TSStorageManagerAppUpgradeNagDate = @"TSStorageManagerAppUpgrade
UIViewController *frontmostViewController = UIViewController *frontmostViewController =
[UIApplication sharedApplication].frontmostViewController; [UIApplication sharedApplication].frontmostViewController;
OWSAssert(frontmostViewController); OWSAssert(frontmostViewController);
BOOL canPresent = ([frontmostViewController isKindOfClass:[SignalsViewController class]] || BOOL canPresent = ([frontmostViewController isKindOfClass:[HomeViewController class]] ||
[frontmostViewController isKindOfClass:[RegistrationViewController class]]); [frontmostViewController isKindOfClass:[RegistrationViewController class]]);
if (!canPresent) { if (!canPresent) {
return; return;

@ -2,7 +2,7 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// //
#import "SignalsViewController.h" #import "HomeViewController.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN

Loading…
Cancel
Save