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

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

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

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1217" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES"> <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"> <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="11757"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<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>
<objects> <objects>

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

@ -3,10 +3,10 @@
// //
#import "Environment.h" #import "Environment.h"
#import "ConversationViewController.h"
#import "DebugLogger.h" #import "DebugLogger.h"
#import "FunctionalUtil.h" #import "FunctionalUtil.h"
#import "HomeViewController.h" #import "HomeViewController.h"
#import "MessagesViewController.h"
#import "Signal-Swift.h" #import "Signal-Swift.h"
#import "SignalKeyingStorage.h" #import "SignalKeyingStorage.h"
#import "TSContactThread.h" #import "TSContactThread.h"
@ -195,8 +195,8 @@ static Environment *environment = nil;
HomeViewController *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:[ConversationViewController class]]) {
MessagesViewController *mvc = (MessagesViewController *)topvc; ConversationViewController *mvc = (ConversationViewController *)topvc;
if ([mvc.thread.uniqueId isEqualToString:threadId]) { if ([mvc.thread.uniqueId isEqualToString:threadId]) {
[mvc popKeyBoard]; [mvc popKeyBoard];
return; return;

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

Loading…
Cancel
Save