Retain changes from session database branch.

This commit is contained in:
Matthew Chen 2018-01-10 11:37:26 -05:00
parent 9ac2383a2c
commit 1839b10550
4 changed files with 9 additions and 15 deletions

View File

@ -137,11 +137,11 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(yapDatabaseModified:)
name:YapDatabaseModifiedNotification
object:TSStorageManager.sharedManager.dbNotificationObject];
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(yapDatabaseModifiedExternally:)
name:YapDatabaseModifiedExternallyNotification
object:TSStorageManager.sharedManager.dbNotificationObject];
object:nil];
}
- (void)dealloc

View File

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "TSStorageManager.h"
@ -127,12 +127,12 @@ NSString *const TSStorageManagerExceptionName_CouldNotCreateDatabaseDirectory
{
// The old database location was in the Document directory,
// so protect the database files individually.
[OWSFileSystem protectFolderAtPath:self.legacyDatabaseFilePath];
[OWSFileSystem protectFolderAtPath:self.legacyDatabaseFilePath_SHM];
[OWSFileSystem protectFolderAtPath:self.legacyDatabaseFilePath_WAL];
[OWSFileSystem protectFileOrFolderAtPath:self.legacyDatabaseFilePath];
[OWSFileSystem protectFileOrFolderAtPath:self.legacyDatabaseFilePath_SHM];
[OWSFileSystem protectFileOrFolderAtPath:self.legacyDatabaseFilePath_WAL];
// Protect the entire new database directory.
[OWSFileSystem protectFolderAtPath:self.sharedDataDatabaseDirPath];
[OWSFileSystem protectFileOrFolderAtPath:self.sharedDataDatabaseDirPath];
}
- (BOOL)userSetPassword {

View File

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSDispatch.h"
@ -40,8 +40,4 @@ NS_ASSUME_NONNULL_BEGIN
@end
void AssertIsOnMainThread() {
OWSCAssert([NSThread isMainThread]);
}
NS_ASSUME_NONNULL_END

View File

@ -4,6 +4,7 @@
#import "ShareAppExtensionContext.h"
#import <SignalMessaging/UIViewController+OWS.h>
#import <SignalServiceKit/OWSStorage.h>
NS_ASSUME_NONNULL_BEGIN
@ -91,9 +92,6 @@ NS_ASSUME_NONNULL_BEGIN
DDLogInfo(@"%@ %s", self.logTag, __PRETTY_FUNCTION__);
// We want to prod OWSStorage here so that all storage is valid.
[OWSStorage applicationWillEnterForeground];
[NSNotificationCenter.defaultCenter postNotificationName:OWSApplicationWillEnterForegroundNotification object:nil];
}