Retain changes from session database branch.

pull/1/head
Matthew Chen 8 years ago
parent 9ac2383a2c
commit 1839b10550

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

@ -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" #import "TSStorageManager.h"
@ -127,12 +127,12 @@ NSString *const TSStorageManagerExceptionName_CouldNotCreateDatabaseDirectory
{ {
// The old database location was in the Document directory, // The old database location was in the Document directory,
// so protect the database files individually. // so protect the database files individually.
[OWSFileSystem protectFolderAtPath:self.legacyDatabaseFilePath]; [OWSFileSystem protectFileOrFolderAtPath:self.legacyDatabaseFilePath];
[OWSFileSystem protectFolderAtPath:self.legacyDatabaseFilePath_SHM]; [OWSFileSystem protectFileOrFolderAtPath:self.legacyDatabaseFilePath_SHM];
[OWSFileSystem protectFolderAtPath:self.legacyDatabaseFilePath_WAL]; [OWSFileSystem protectFileOrFolderAtPath:self.legacyDatabaseFilePath_WAL];
// Protect the entire new database directory. // Protect the entire new database directory.
[OWSFileSystem protectFolderAtPath:self.sharedDataDatabaseDirPath]; [OWSFileSystem protectFileOrFolderAtPath:self.sharedDataDatabaseDirPath];
} }
- (BOOL)userSetPassword { - (BOOL)userSetPassword {

@ -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" #import "OWSDispatch.h"
@ -40,8 +40,4 @@ NS_ASSUME_NONNULL_BEGIN
@end @end
void AssertIsOnMainThread() {
OWSCAssert([NSThread isMainThread]);
}
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -4,6 +4,7 @@
#import "ShareAppExtensionContext.h" #import "ShareAppExtensionContext.h"
#import <SignalMessaging/UIViewController+OWS.h> #import <SignalMessaging/UIViewController+OWS.h>
#import <SignalServiceKit/OWSStorage.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@ -91,9 +92,6 @@ NS_ASSUME_NONNULL_BEGIN
DDLogInfo(@"%@ %s", self.logTag, __PRETTY_FUNCTION__); 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]; [NSNotificationCenter.defaultCenter postNotificationName:OWSApplicationWillEnterForegroundNotification object:nil];
} }

Loading…
Cancel
Save