From 7ebeeda5f9cf9011b4db83af4a6e3932337b03c5 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Mon, 29 Jan 2018 12:50:17 -0500 Subject: [PATCH] Clean up ahead of PR. --- Signal/src/AppDelegate.m | 20 +++++++++---------- .../ViewControllers/DebugUI/DebugUIMessages.m | 8 -------- .../SignalsNavigationController.m | 6 +----- .../Messages/Attachments/TSAttachmentStream.m | 4 ++-- .../Messages/Interactions/TSIncomingMessage.m | 6 +++--- 5 files changed, 16 insertions(+), 28 deletions(-) diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index 01a727334..fd644f29c 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -785,16 +785,16 @@ static NSString *const kURLHostVerifyPrefix = @"verify"; self.isEnvironmentSetup = YES; - //#ifdef DEBUG - // // A bug in orphan cleanup could be disastrous so let's only - // // run it in DEBUG builds for a few releases. - // // - // // TODO: Release to production once we have analytics. - // // TODO: Orphan cleanup is somewhat expensive - not least in doing a bunch - // // of disk access. We might want to only run it "once per version" - // // or something like that in production. - // [OWSOrphanedDataCleaner auditAndCleanupAsync:nil]; - //#endif +#ifdef DEBUG + // A bug in orphan cleanup could be disastrous so let's only + // run it in DEBUG builds for a few releases. + // + // TODO: Release to production once we have analytics. + // TODO: Orphan cleanup is somewhat expensive - not least in doing a bunch + // of disk access. We might want to only run it "once per version" + // or something like that in production. + [OWSOrphanedDataCleaner auditAndCleanupAsync:nil]; +#endif [OWSProfileManager.sharedManager fetchLocalUsersProfile]; [[OWSReadReceiptManager sharedManager] prepareCachedValues]; diff --git a/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m b/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m index 4c7692cf6..3f53fbe08 100644 --- a/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m +++ b/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m @@ -1030,8 +1030,6 @@ NS_ASSUME_NONNULL_BEGIN authorId:@"+19174054215" sourceDeviceId:0 messageBody:randomText]; - // DDLogError(@"%@ sendFakeMessages incoming timestamp: %llu.", self.logTag, - // message.timestamp); [message markAsReadWithTransaction:transaction sendReadReceipt:NO updateExpiration:NO]; break; } @@ -1040,8 +1038,6 @@ NS_ASSUME_NONNULL_BEGIN [[TSOutgoingMessage alloc] initWithTimestamp:[NSDate ows_millisecondTimeStamp] inThread:thread messageBody:randomText]; - // DDLogError(@"%@ sendFakeMessages outgoing timestamp: %llu.", self.logTag, - // message.timestamp); [message saveWithTransaction:transaction]; [message updateWithMessageState:TSOutgoingMessageStateUnsent transaction:transaction]; break; @@ -1069,8 +1065,6 @@ NS_ASSUME_NONNULL_BEGIN pointer.uniqueId, ] expiresInSeconds:0]; - // DDLogError(@"%@ sendFakeMessages incoming attachment timestamp: %llu.", self.logTag, - // message.timestamp); [message markAsReadWithTransaction:transaction sendReadReceipt:NO updateExpiration:NO]; break; } @@ -1081,8 +1075,6 @@ NS_ASSUME_NONNULL_BEGIN messageBody:nil isVoiceMessage:NO expiresInSeconds:0]; - // DDLogError(@"%@ sendFakeMessages outgoing attachment timestamp: %llu.", self.logTag, - // message.timestamp); NSString *filename = @"test.mp3"; UInt32 filesize = 16; diff --git a/Signal/src/ViewControllers/SignalsNavigationController.m b/Signal/src/ViewControllers/SignalsNavigationController.m index d48c88592..5314fd7dd 100644 --- a/Signal/src/ViewControllers/SignalsNavigationController.m +++ b/Signal/src/ViewControllers/SignalsNavigationController.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // #import "SignalsNavigationController.h" @@ -36,11 +36,7 @@ static double const STALLED_PROGRESS = 0.9; CGRect bar = self.navigationBar.frame; _socketStatusView.frame = CGRectMake(0, bar.size.height - 1.0f, self.view.frame.size.width, 1.0f); _socketStatusView.progress = 0.0f; -#ifdef INTERNAL - _socketStatusView.progressTintColor = [UIColor ows_destructiveRedColor]; -#else _socketStatusView.progressTintColor = [UIColor ows_fadedBlueColor]; -#endif if (![_socketStatusView superview]) { [self.navigationBar addSubview:_socketStatusView]; diff --git a/SignalServiceKit/src/Messages/Attachments/TSAttachmentStream.m b/SignalServiceKit/src/Messages/Attachments/TSAttachmentStream.m index d52f056a4..e07c06613 100644 --- a/SignalServiceKit/src/Messages/Attachments/TSAttachmentStream.m +++ b/SignalServiceKit/src/Messages/Attachments/TSAttachmentStream.m @@ -162,7 +162,7 @@ NS_ASSUME_NONNULL_BEGIN OWSFail(@"%@ Missing path for attachment.", self.logTag); return NO; } - DDLogInfo(@"%@ Writing attachment data to file: %@", self.logTag, filePath); + DDLogInfo(@"%@ Writing attachment to file: %@", self.logTag, filePath); return [data writeToFile:filePath options:0 error:error]; } @@ -175,7 +175,7 @@ NS_ASSUME_NONNULL_BEGIN OWSFail(@"%@ Missing path for attachment.", self.logTag); return NO; } - DDLogInfo(@"%@ Writing attachment data source to file: %@", self.logTag, filePath); + DDLogInfo(@"%@ Writing attachment to file: %@", self.logTag, filePath); return [dataSource writeToPath:filePath]; } diff --git a/SignalServiceKit/src/Messages/Interactions/TSIncomingMessage.m b/SignalServiceKit/src/Messages/Interactions/TSIncomingMessage.m index b13c33db2..d91d036bb 100644 --- a/SignalServiceKit/src/Messages/Interactions/TSIncomingMessage.m +++ b/SignalServiceKit/src/Messages/Interactions/TSIncomingMessage.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // #import "TSIncomingMessage.h" @@ -156,8 +156,8 @@ NS_ASSUME_NONNULL_BEGIN return; } - // DDLogDebug( - // @"%@ marking as read uniqueId: %@ which has timestamp: %llu", self.logTag, self.uniqueId, self.timestamp); + DDLogDebug( + @"%@ marking as read uniqueId: %@ which has timestamp: %llu", self.logTag, self.uniqueId, self.timestamp); _read = YES; [self saveWithTransaction:transaction]; [self touchThreadWithTransaction:transaction];