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

pull/1/head
Matthew Chen 7 years ago
commit b3c62d91be

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

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

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

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

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

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

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

Loading…
Cancel
Save