Rename conversation view.

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

@ -25,8 +25,8 @@
3448BFCC1EDF0EA7005B2D69 /* OWSMessagesToolbarContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3448BFC21EDF0EA7005B2D69 /* OWSMessagesToolbarContentView.m */; };
3448BFCD1EDF0EA7005B2D69 /* OWSMessagesInputToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = 3448BFC41EDF0EA7005B2D69 /* OWSMessagesInputToolbar.m */; };
3448BFCF1EDF0EA7005B2D69 /* OWSMessagesComposerTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3448BFC81EDF0EA7005B2D69 /* OWSMessagesComposerTextView.m */; };
3448BFD01EDF0EA7005B2D69 /* MessagesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3448BFCA1EDF0EA7005B2D69 /* MessagesViewController.m */; };
3448BFD11EDF0EA7005B2D69 /* MessagesViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3448BFCB1EDF0EA7005B2D69 /* MessagesViewController.xib */; };
3448BFD01EDF0EA7005B2D69 /* ConversationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3448BFCA1EDF0EA7005B2D69 /* ConversationViewController.m */; };
3448BFD11EDF0EA7005B2D69 /* ConversationViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3448BFCB1EDF0EA7005B2D69 /* ConversationViewController.xib */; };
344F2F671E57A932000D9322 /* UIViewController+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = 344F2F661E57A932000D9322 /* UIViewController+OWS.m */; };
34533F181EA8D2070006114F /* OWSAudioAttachmentPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 34533F171EA8D2070006114F /* OWSAudioAttachmentPlayer.m */; };
34535D821E256BE9008A4747 /* UIView+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = 34535D811E256BE9008A4747 /* UIView+OWS.m */; };
@ -432,9 +432,9 @@
3448BFC41EDF0EA7005B2D69 /* OWSMessagesInputToolbar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSMessagesInputToolbar.m; sourceTree = "<group>"; };
3448BFC71EDF0EA7005B2D69 /* OWSMessagesComposerTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSMessagesComposerTextView.h; sourceTree = "<group>"; };
3448BFC81EDF0EA7005B2D69 /* OWSMessagesComposerTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSMessagesComposerTextView.m; sourceTree = "<group>"; };
3448BFC91EDF0EA7005B2D69 /* MessagesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessagesViewController.h; sourceTree = "<group>"; };
3448BFCA1EDF0EA7005B2D69 /* MessagesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MessagesViewController.m; sourceTree = "<group>"; };
3448BFCB1EDF0EA7005B2D69 /* MessagesViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MessagesViewController.xib; sourceTree = "<group>"; };
3448BFC91EDF0EA7005B2D69 /* ConversationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConversationViewController.h; sourceTree = "<group>"; };
3448BFCA1EDF0EA7005B2D69 /* ConversationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConversationViewController.m; sourceTree = "<group>"; };
3448BFCB1EDF0EA7005B2D69 /* ConversationViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ConversationViewController.xib; sourceTree = "<group>"; };
344F2F651E57A932000D9322 /* UIViewController+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIViewController+OWS.h"; path = "util/UIViewController+OWS.h"; sourceTree = "<group>"; };
344F2F661E57A932000D9322 /* UIViewController+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIViewController+OWS.m"; path = "util/UIViewController+OWS.m"; sourceTree = "<group>"; };
34533F161EA8D2070006114F /* OWSAudioAttachmentPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSAudioAttachmentPlayer.h; sourceTree = "<group>"; };
@ -966,9 +966,9 @@
3448BFC01EDF0EA7005B2D69 /* ConversationView */ = {
isa = PBXGroup;
children = (
3448BFC91EDF0EA7005B2D69 /* MessagesViewController.h */,
3448BFCA1EDF0EA7005B2D69 /* MessagesViewController.m */,
3448BFCB1EDF0EA7005B2D69 /* MessagesViewController.xib */,
3448BFC91EDF0EA7005B2D69 /* ConversationViewController.h */,
3448BFCA1EDF0EA7005B2D69 /* ConversationViewController.m */,
3448BFCB1EDF0EA7005B2D69 /* ConversationViewController.xib */,
3448BFC71EDF0EA7005B2D69 /* OWSMessagesComposerTextView.h */,
3448BFC81EDF0EA7005B2D69 /* OWSMessagesComposerTextView.m */,
3448BFC31EDF0EA7005B2D69 /* OWSMessagesInputToolbar.h */,
@ -1995,7 +1995,7 @@
B633C59D1A1D190B0059AC12 /* endcall@2x.png in Resources */,
FC5CDF391A3393DD00B47253 /* error_white@2x.png in Resources */,
B633C5D21A1D190B0059AC12 /* savephoto@2x.png in Resources */,
3448BFD11EDF0EA7005B2D69 /* MessagesViewController.xib in Resources */,
3448BFD11EDF0EA7005B2D69 /* ConversationViewController.xib in Resources */,
B10C9B611A7049EC00ECA2BF /* play_icon.png in Resources */,
AD83FF401A73426500B5C81A /* audio_pause_button_blue@2x.png in Resources */,
B66DBF4A19D5BBC8006EA940 /* Images.xcassets in Resources */,
@ -2348,7 +2348,7 @@
34B3F88D1E8DF1700035BE1A /* OWSQRCodeScanningViewController.m in Sources */,
34B3F8811E8DF1700035BE1A /* LockInteractionController.m in Sources */,
3448BFCC1EDF0EA7005B2D69 /* OWSMessagesToolbarContentView.m in Sources */,
3448BFD01EDF0EA7005B2D69 /* MessagesViewController.m in Sources */,
3448BFD01EDF0EA7005B2D69 /* ConversationViewController.m in Sources */,
34CCAF3B1F0C2748004084F4 /* OWSAddToContactViewController.m in Sources */,
45F659731E1BD99C00444429 /* CallKitCallUIAdaptee.swift in Sources */,
45BB93381E688E14001E3939 /* UIDevice+featureSupport.swift in Sources */,

@ -6,9 +6,9 @@
@class TSThread;
extern NSString *const OWSMessagesViewControllerDidAppearNotification;
extern NSString *const ConversationViewControllerDidAppearNotification;
@interface MessagesViewController : JSQMessagesViewController
@interface ConversationViewController : JSQMessagesViewController
@property (nonatomic, readonly) TSThread *thread;

@ -2,7 +2,7 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "MessagesViewController.h"
#import "ConversationViewController.h"
#import "AppDelegate.h"
#import "AttachmentSharing.h"
#import "BlockListUIUtils.h"
@ -106,7 +106,7 @@ static const int JSQ_IMAGE_INSET = 5;
static NSTimeInterval const kTSMessageSentDateShowTimeInterval = 5 * kMinuteInterval;
NSString *const OWSMessagesViewControllerDidAppearNotification = @"OWSMessagesViewControllerDidAppear";
NSString *const ConversationViewControllerDidAppearNotification = @"ConversationViewControllerDidAppear";
typedef enum : NSUInteger {
kMediaTypePicture,
@ -154,7 +154,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
#pragma mark -
@interface MessagesViewController () <AVAudioPlayerDelegate,
@interface ConversationViewController () <AVAudioPlayerDelegate,
ContactsViewHelperDelegate,
ContactEditingDelegate,
CNContactViewControllerDelegate,
@ -252,7 +252,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
#pragma mark -
@implementation MessagesViewController
@implementation ConversationViewController
- (void)dealloc
{
@ -979,7 +979,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
__weak MessagesViewController *weakSelf = self;
__weak ConversationViewController *weakSelf = self;
UIAlertAction *verifyAction = [UIAlertAction
actionWithTitle:(hasMultiple ? NSLocalizedString(@"VERIFY_PRIVACY_MULTIPLE",
@"Label for button or row which allows users to verify the safety "
@ -1145,7 +1145,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
- (void)startExpirationTimerAnimations
{
[[NSNotificationCenter defaultCenter] postNotificationName:OWSMessagesViewControllerDidAppearNotification
[[NSNotificationCenter defaultCenter] postNotificationName:ConversationViewControllerDidAppearNotification
object:nil];
}
@ -1517,7 +1517,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
return;
}
__weak MessagesViewController *weakSelf = self;
__weak ConversationViewController *weakSelf = self;
if ([self isBlockedContactConversation]) {
[self showUnblockContactUI:^(BOOL isBlocked) {
if (!isBlocked) {
@ -1571,7 +1571,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
updateKeyboardState:(BOOL)updateKeyboardState
{
__weak MessagesViewController *weakSelf = self;
__weak ConversationViewController *weakSelf = self;
if ([self isBlockedContactConversation]) {
[self showUnblockContactUI:^(BOOL isBlocked) {
if (!isBlocked) {
@ -2737,19 +2737,19 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
}];
[actionSheetController addAction:showSafteyNumberAction];
UIAlertAction *acceptSafetyNumberAction = [UIAlertAction
actionWithTitle:NSLocalizedString(@"ACCEPT_NEW_IDENTITY_ACTION", @"Action sheet item")
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *_Nonnull action) {
DDLogInfo(@"%@ Remote Key Changed actions: Accepted new identity key", self.tag);
// DEPRECATED: we're no longer creating these incoming SN error's per message,
// but there will be some legacy ones in the wild, behind which await as-of-yet-undecrypted
// messages
if ([errorMessage isKindOfClass:[TSInvalidIdentityKeyReceivingErrorMessage class]]) {
[errorMessage acceptNewIdentityKey];
}
}];
UIAlertAction *acceptSafetyNumberAction =
[UIAlertAction actionWithTitle:NSLocalizedString(@"ACCEPT_NEW_IDENTITY_ACTION", @"Action sheet item")
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *_Nonnull action) {
DDLogInfo(@"%@ Remote Key Changed actions: Accepted new identity key", self.tag);
// DEPRECATED: we're no longer creating these incoming SN error's per message,
// but there will be some legacy ones in the wild, behind which await
// as-of-yet-undecrypted messages
if ([errorMessage isKindOfClass:[TSInvalidIdentityKeyReceivingErrorMessage class]]) {
[errorMessage acceptNewIdentityKey];
}
}];
[actionSheetController addAction:acceptSafetyNumberAction];
[self presentViewController:actionSheetController animated:YES completion:nil];
@ -2772,7 +2772,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
message:[NSString stringWithFormat:[CallStrings callBackAlertMessageFormat], displayName]
preferredStyle:UIAlertControllerStyleAlert];
__weak MessagesViewController *weakSelf = self;
__weak ConversationViewController *weakSelf = self;
UIAlertAction *callAction = [UIAlertAction actionWithTitle:[CallStrings callBackAlertCallButton]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *_Nonnull action) {
@ -2808,21 +2808,20 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
[actionSheetController addAction:[OWSAlerts cancelAction]];
UIAlertAction *blockAction =
[UIAlertAction actionWithTitle:NSLocalizedString(@"BLOCK_OFFER_ACTIONSHEET_BLOCK_ACTION",
@"Action sheet that will block an unknown user.")
style:UIAlertActionStyleDestructive
handler:^(UIAlertAction *_Nonnull action) {
DDLogInfo(@"%@ Blocking an unknown user.", self.tag);
[self.blockingManager addBlockedPhoneNumber:interaction.recipientId];
// Delete the offers.
[self.editingDatabaseConnection
readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
contactThread.hasDismissedOffers = YES;
[contactThread saveWithTransaction:transaction];
[interaction removeWithTransaction:transaction];
}];
}];
UIAlertAction *blockAction = [UIAlertAction
actionWithTitle:NSLocalizedString(
@"BLOCK_OFFER_ACTIONSHEET_BLOCK_ACTION", @"Action sheet that will block an unknown user.")
style:UIAlertActionStyleDestructive
handler:^(UIAlertAction *_Nonnull action) {
DDLogInfo(@"%@ Blocking an unknown user.", self.tag);
[self.blockingManager addBlockedPhoneNumber:interaction.recipientId];
// Delete the offers.
[self.editingDatabaseConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
contactThread.hasDismissedOffers = YES;
[contactThread saveWithTransaction:transaction];
[interaction removeWithTransaction:transaction];
}];
}];
[actionSheetController addAction:blockAction];
[self presentViewController:actionSheetController animated:YES completion:nil];
@ -3507,11 +3506,10 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
NSArray *messageRowChanges = nil;
NSArray *sectionChanges = nil;
[[self.uiDatabaseConnection ext:TSMessageDatabaseViewExtensionName]
getSectionChanges:&sectionChanges
rowChanges:&messageRowChanges
forNotifications:notifications
withMappings:self.messageMappings];
[[self.uiDatabaseConnection ext:TSMessageDatabaseViewExtensionName] getSectionChanges:&sectionChanges
rowChanges:&messageRowChanges
forNotifications:notifications
withMappings:self.messageMappings];
if ([sectionChanges count] == 0 && [messageRowChanges count] == 0) {
// YapDatabase will ignore insertions within the message mapping's
@ -3860,7 +3858,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
- (void)didPressAccessoryButton:(UIButton *)sender
{
__weak MessagesViewController *weakSelf = self;
__weak ConversationViewController *weakSelf = self;
if ([self isBlockedContactConversation]) {
[self showUnblockContactUI:^(BOOL isBlocked) {
if (!isBlocked) {
@ -4130,7 +4128,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
// Max out the unread count at 99+.
const NSUInteger kMaxUnreadCount = 99;
_backButtonUnreadCountLabel.text = [ViewControllerUtils formatInt:(int) MIN(kMaxUnreadCount, unreadCount)];
_backButtonUnreadCountLabel.text = [ViewControllerUtils formatInt:(int)MIN(kMaxUnreadCount, unreadCount)];
}
#pragma mark 3D Touch Preview Actions
@ -4185,7 +4183,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
DDLogError(@"%@ %s", self.tag, __PRETTY_FUNCTION__);
DispatchMainThreadSafe(^{
__weak MessagesViewController *weakSelf = self;
__weak ConversationViewController *weakSelf = self;
if ([self isBlockedContactConversation]) {
[self showUnblockContactUI:^(BOOL isBlocked) {
if (!isBlocked) {
@ -4540,14 +4538,14 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
+ (UINib *)nib
{
return [UINib nibWithNibName:NSStringFromClass([MessagesViewController class])
bundle:[NSBundle bundleForClass:[MessagesViewController class]]];
return [UINib nibWithNibName:NSStringFromClass([ConversationViewController class])
bundle:[NSBundle bundleForClass:[ConversationViewController class]]];
}
+ (instancetype)messagesViewController
{
return [[[self class] alloc] initWithNibName:NSStringFromClass([MessagesViewController class])
bundle:[NSBundle bundleForClass:[MessagesViewController class]]];
return [[[self class] alloc] initWithNibName:NSStringFromClass([ConversationViewController class])
bundle:[NSBundle bundleForClass:[ConversationViewController class]]];
}
#pragma mark - Logging

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1217" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>

@ -5,8 +5,8 @@
#import "HomeViewController.h"
#import "AppDelegate.h"
#import "AppSettingsViewController.h"
#import "ConversationViewController.h"
#import "InboxTableViewCell.h"
#import "MessagesViewController.h"
#import "NSDate+millisecondTimeStamp.h"
#import "NewContactThreadViewController.h"
#import "OWSContactsManager.h"
@ -326,7 +326,7 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
if (indexPath) {
[previewingContext setSourceRect:[self.tableView rectForRowAtIndexPath:indexPath]];
MessagesViewController *vc = [MessagesViewController new];
ConversationViewController *vc = [ConversationViewController new];
TSThread *thread = [self threadForIndexPath:indexPath];
self.lastThread = thread;
[vc configureForThread:thread keyboardOnViewAppearing:NO callOnViewAppearing:NO];
@ -341,7 +341,7 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
- (void)previewingContext:(id<UIViewControllerPreviewing>)previewingContext
commitViewController:(UIViewController *)viewControllerToCommit
{
MessagesViewController *vc = (MessagesViewController *)viewControllerToCommit;
ConversationViewController *vc = (ConversationViewController *)viewControllerToCommit;
[vc popped];
[self.navigationController pushViewController:vc animated:NO];
@ -758,8 +758,8 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
// We do this synchronously if we're already on the main thread.
DispatchMainThreadSafe(^{
MessagesViewController *mvc =
[[MessagesViewController alloc] initWithNibName:@"MessagesViewController" bundle:nil];
ConversationViewController *mvc =
[[ConversationViewController alloc] initWithNibName:@"ConversationViewController" bundle:nil];
[mvc configureForThread:thread
keyboardOnViewAppearing:keyboardOnViewAppearing
callOnViewAppearing:callOnViewAppearing];

@ -3,10 +3,10 @@
//
#import "Environment.h"
#import "ConversationViewController.h"
#import "DebugLogger.h"
#import "FunctionalUtil.h"
#import "HomeViewController.h"
#import "MessagesViewController.h"
#import "Signal-Swift.h"
#import "SignalKeyingStorage.h"
#import "TSContactThread.h"
@ -195,8 +195,8 @@ static Environment *environment = nil;
HomeViewController *vc = env.signalsViewController;
UIViewController *topvc = vc.navigationController.topViewController;
if ([topvc isKindOfClass:[MessagesViewController class]]) {
MessagesViewController *mvc = (MessagesViewController *)topvc;
if ([topvc isKindOfClass:[ConversationViewController class]]) {
ConversationViewController *mvc = (ConversationViewController *)topvc;
if ([mvc.thread.uniqueId isEqualToString:threadId]) {
[mvc popKeyBoard];
return;

@ -3,7 +3,7 @@
//
#import "OWSExpirationTimerView.h"
#import "MessagesViewController.h"
#import "ConversationViewController.h"
#import "UIColor+OWS.h"
#import <QuartzCore/CAShapeLayer.h>
@ -110,7 +110,7 @@ double const OWSExpirationTimerViewBlinkingSeconds = 2;
self.initialDurationSeconds = initialDurationSeconds;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleReappearNotification:)
name:OWSMessagesViewControllerDidAppearNotification
name:ConversationViewControllerDidAppearNotification
object:nil];
[self startAnimation];
}
@ -176,7 +176,7 @@ double const OWSExpirationTimerViewBlinkingSeconds = 2;
- (void)stopTimer
{
[[NSNotificationCenter defaultCenter] removeObserver:self
name:OWSMessagesViewControllerDidAppearNotification
name:ConversationViewControllerDidAppearNotification
object:nil];
[self.layer removeAnimationForKey:@"alphaBlink"];

Loading…
Cancel
Save