diff --git a/SignalServiceKit/src/Util/OWSFileSystem.m b/SignalServiceKit/src/Util/OWSFileSystem.m index 9c633b648..d206b40b2 100644 --- a/SignalServiceKit/src/Util/OWSFileSystem.m +++ b/SignalServiceKit/src/Util/OWSFileSystem.m @@ -55,12 +55,14 @@ NS_ASSUME_NONNULL_BEGIN sharedDataFilePath:(NSString *)newFilePath exceptionName:(NSString *)exceptionName { + DDLogInfo(@"%@ Moving file or directory from: %@ to: %@", self.logTag, oldFilePath, newFilePath); + NSFileManager *fileManager = [NSFileManager defaultManager]; if (![fileManager fileExistsAtPath:oldFilePath]) { return; } if ([fileManager fileExistsAtPath:newFilePath]) { - OWSFail(@"%@ Can't move file or directory from %@ to %@; destination already exists.", + OWSFail(@"%@ Can't move file or directory from: %@ to: %@; destination already exists.", self.logTag, oldFilePath, newFilePath); @@ -73,7 +75,7 @@ NS_ASSUME_NONNULL_BEGIN BOOL success = [fileManager moveItemAtPath:oldFilePath toPath:newFilePath error:&error]; if (!success || error) { NSString *errorDescription = - [NSString stringWithFormat:@"%@ Could not move file or directory from %@ to %@, error: %@", + [NSString stringWithFormat:@"%@ Could not move file or directory from: %@ to: %@, error: %@", self.logTag, oldFilePath, newFilePath, @@ -81,12 +83,12 @@ NS_ASSUME_NONNULL_BEGIN OWSFail(@"%@", errorDescription); [NSException raise:exceptionName format:@"%@", errorDescription]; } - - DDLogInfo(@"%@ Moving file or directory from %@ to %@ in: %f", - self.logTag, - oldFilePath, - newFilePath, - fabs([startDate timeIntervalSinceNow])); + + DDLogInfo(@"%@ Moved file or directory from: %@ to: %@ in: %f", + self.logTag, + oldFilePath, + newFilePath, + fabs([startDate timeIntervalSinceNow])); } + (BOOL)ensureDirectoryExists:(NSString *)dirPath @@ -98,6 +100,8 @@ NS_ASSUME_NONNULL_BEGIN return YES; } else { + DDLogInfo(@"%@ Creating directory at: %@", self.logTag, dirPath); + NSError *error = nil; [[NSFileManager defaultManager] createDirectoryAtPath:dirPath withIntermediateDirectories:YES diff --git a/SignalShareExtension/ShareViewController.swift b/SignalShareExtension/ShareViewController.swift index ca9093864..69e74f11e 100644 --- a/SignalShareExtension/ShareViewController.swift +++ b/SignalShareExtension/ShareViewController.swift @@ -39,12 +39,6 @@ public class ShareViewController: UINavigationController, SAELoadViewDelegate, S // We don't need to use DeviceSleepManager in the SAE. - AppSetup.setupEnvironment({ - return NoopCallMessageHandler() - }) { - return NoopNotificationsManager() - } - // TODO: // [UIUtil applySignalAppearence]; @@ -71,6 +65,12 @@ public class ShareViewController: UINavigationController, SAELoadViewDelegate, S return } + AppSetup.setupEnvironment({ + return NoopCallMessageHandler() + }) { + return NoopNotificationsManager() + } + // performUpdateCheck must be invoked after Environment has been initialized because // upgrade process may depend on Environment. VersionMigrations.performUpdateCheck()