Merge remote-tracking branch 'origin/release/2.28.1'

This commit is contained in:
Matthew Chen 2018-08-08 13:51:52 -04:00
commit b3c62d91be
7 changed files with 24 additions and 5 deletions

View File

@ -38,7 +38,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>2.28.1.1</string>
<string>2.28.1.5</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LOGS_EMAIL</key>

View File

@ -814,6 +814,7 @@ typedef enum : NSUInteger {
{
// Avoid layout corrupt issues and out-of-date message subtitles.
self.lastReloadDate = [NSDate new];
self.collapseCutoffDate = [NSDate new];
[self reloadViewItems];
[self.collectionView.collectionViewLayout invalidateLayout];
[self.collectionView reloadData];
@ -1770,6 +1771,7 @@ typedef enum : NSUInteger {
[self.messageMappings setRangeOptions:rangeOptions forGroup:self.thread.uniqueId];
[self updateShowLoadMoreHeader];
self.collapseCutoffDate = [NSDate new];
[self reloadViewItems];
}
@ -4801,6 +4803,7 @@ typedef enum : NSUInteger {
}];
[self updateMessageMappingRangeOptions];
}
self.collapseCutoffDate = [NSDate new];
[self reloadViewItems];
[self resetContentAndLayout];
@ -4838,8 +4841,6 @@ typedef enum : NSUInteger {
// cell view models.
- (void)reloadViewItems
{
self.collapseCutoffDate = [NSDate new];
NSMutableArray<ConversationViewItem *> *viewItems = [NSMutableArray new];
NSMutableDictionary<NSString *, ConversationViewItem *> *viewItemCache = [NSMutableDictionary new];

View File

@ -25,6 +25,7 @@ NS_ASSUME_NONNULL_BEGIN
@implementation MainAppContext
@synthesize mainWindow = _mainWindow;
@synthesize appLaunchTime = _appLaunchTime;
- (instancetype)init
{
@ -36,6 +37,8 @@ NS_ASSUME_NONNULL_BEGIN
self.reportedApplicationState = UIApplicationStateInactive;
_appLaunchTime = [NSDate new];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationWillEnterForeground:)
name:UIApplicationWillEnterForegroundNotification

View File

@ -3,6 +3,8 @@
//
#import "OWSIncompleteCallsJob.h"
#import "AppContext.h"
#import "NSDate+OWS.h"
#import "OWSPrimaryStorage.h"
#import "TSCall.h"
#import <YapDatabase/YapDatabase.h>
@ -78,9 +80,17 @@ static NSString *const OWSIncompleteCallsJobCallTypeIndex = @"index_calls_on_cal
{
__block uint count = 0;
OWSAssert(CurrentAppContext().appLaunchTime);
uint64_t cutoffTimestamp = [NSDate ows_millisecondsSince1970ForDate:CurrentAppContext().appLaunchTime];
[[self.primaryStorage newDatabaseConnection] readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
[self
enumerateIncompleteCallsWithBlock:^(TSCall *call) {
if (call.timestamp <= cutoffTimestamp) {
DDLogInfo(@"%@ ignoring new call: %@", self.logTag, call.uniqueId);
return;
}
if (call.callType == RPRecentCallTypeOutgoingIncomplete) {
DDLogDebug(@"%@ marking call as missed: %@", self.logTag, call.uniqueId);
[call updateCallType:RPRecentCallTypeOutgoingMissed transaction:transaction];
@ -99,7 +109,7 @@ static NSString *const OWSIncompleteCallsJobCallTypeIndex = @"index_calls_on_cal
transaction:transaction];
}];
DDLogDebug(@"%@ Marked %u calls as missed", self.logTag, count);
DDLogInfo(@"%@ Marked %u calls as missed", self.logTag, count);
}
#pragma mark - YapDatabaseExtension

View File

@ -94,6 +94,8 @@ NSString *NSStringForUIApplicationState(UIApplicationState value);
- (void)runNowOrWhenMainAppIsActive:(AppActiveBlock)block;
@property (atomic, readonly) NSDate *appLaunchTime;
@end
id<AppContext> CurrentAppContext(void);

View File

@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>2.28.1</string>
<key>CFBundleVersion</key>
<string>2.28.1.1</string>
<string>2.28.1.5</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>NSAppTransportSecurity</key>

View File

@ -21,6 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
@implementation ShareAppExtensionContext
@synthesize mainWindow = _mainWindow;
@synthesize appLaunchTime = _appLaunchTime;
- (instancetype)initWithRootViewController:(UIViewController *)rootViewController
{
@ -36,6 +37,8 @@ NS_ASSUME_NONNULL_BEGIN
self.reportedApplicationState = UIApplicationStateActive;
_appLaunchTime = [NSDate new];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(extensionHostDidBecomeActive:)
name:NSExtensionHostDidBecomeActiveNotification