diff --git a/Podfile.lock b/Podfile.lock index 13dd01948..a954ce96a 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -81,7 +81,7 @@ EXTERNAL SOURCES: CHECKOUT OPTIONS: JSQMessagesViewController: - :commit: 6a30411791a52d1a605fa03733eab8ce47655b7f + :commit: 84d1b659f350ac3e10464d44b87243fa4622acf4 :git: https://github.com/dtsbourg/JSQMessagesViewController SocketRocket: :commit: d0585af165 diff --git a/Signal/src/UIColor+OWS.m b/Signal/src/UIColor+OWS.m index c606e9373..01b8cd933 100644 --- a/Signal/src/UIColor+OWS.m +++ b/Signal/src/UIColor+OWS.m @@ -45,5 +45,12 @@ { return [UIColor colorWithRed:195.f/255.f green:0 blue:22.f/255.f alpha:1.f]; } + ++ (UIColor *) ows_lightBackgroundColor +{ + return [UIColor colorWithRed:242.f/255.f green:242.f/255.f blue:242.f/255.f alpha:1.f]; +} + + @end diff --git a/Signal/src/view controllers/MessagesViewController.m b/Signal/src/view controllers/MessagesViewController.m index 071328cfd..d4ea5294c 100644 --- a/Signal/src/view controllers/MessagesViewController.m +++ b/Signal/src/view controllers/MessagesViewController.m @@ -141,6 +141,7 @@ typedef enum : NSUInteger { -(void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; + self.automaticallyScrollsToMostRecentMessage = YES; [self scrollToBottomAnimated:NO]; } @@ -155,6 +156,7 @@ typedef enum : NSUInteger { - (void)viewDidAppear:(BOOL)animated{ [super viewDidAppear:animated]; [self startReadTimer]; + [self scrollToBottomAnimated:YES]; } - (void)viewWillDisappear:(BOOL)animated{ @@ -216,7 +218,7 @@ typedef enum : NSUInteger { self.collectionView.showsVerticalScrollIndicator = NO; self.collectionView.showsHorizontalScrollIndicator = NO; - self.automaticallyScrollsToMostRecentMessage = YES; + self.automaticallyScrollsToMostRecentMessage = NO; self.collectionView.collectionViewLayout.incomingAvatarViewSize = CGSizeZero; self.collectionView.collectionViewLayout.outgoingAvatarViewSize = CGSizeZero; @@ -260,14 +262,6 @@ typedef enum : NSUInteger { } } -#pragma mark - JSQMessage custom methods - --(void)updateMessageStatus:(JSQMessage*)message { - if ([message.senderId isEqualToString:self.senderId]){ - message.status = kMessageReceived; - } -} - #pragma mark - JSQMessagesViewController method overrides - (void)didPressSendButton:(UIButton *)button @@ -502,7 +496,7 @@ typedef enum : NSUInteger { return 16.0f; } } - else if (msg.messageType == TSOutgoingMessageAdapter) { + else if ([self shouldShowMessageStatusAtIndexPath:indexPath]) { return 16.0f; } @@ -822,7 +816,9 @@ typedef enum : NSUInteger { return; } + [self.collectionView performBatchUpdates:^{ + for (YapDatabaseViewRowChange *rowChange in messageRowChanges) { switch (rowChange.type) @@ -855,8 +851,9 @@ typedef enum : NSUInteger { } } } + } completion:^(BOOL finished) { - [self finishReceivingMessage]; + [self scrollToBottomAnimated:YES]; }]; }