parent
04cf1c8cb9
commit
fdac0305cb
|
@ -159,6 +159,8 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
|
|||
|
||||
DDLogInfo(@"%@ application: didFinishLaunchingWithOptions completed.", self.tag);
|
||||
|
||||
[OWSAnalytics appLaunchDidBegin];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
@ -794,6 +796,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
|
|||
|
||||
[DeviceSleepManager.sharedInstance removeBlockWithBlockObject:self];
|
||||
|
||||
[OWSAnalytics appLaunchDidComplete];
|
||||
[AppVersion.instance appLaunchDidComplete];
|
||||
|
||||
[self ensureRootViewController];
|
||||
|
|
|
@ -67,6 +67,7 @@
|
|||
#import <MobileCoreServices/UTCoreTypes.h>
|
||||
#import <SignalServiceKit/ContactsUpdater.h>
|
||||
#import <SignalServiceKit/MimeTypeUtil.h>
|
||||
#import <SignalServiceKit/NSDate+OWS.h>
|
||||
#import <SignalServiceKit/NSTimer+OWS.h>
|
||||
#import <SignalServiceKit/OWSAddToContactsOfferMessage.h>
|
||||
#import <SignalServiceKit/OWSAttachmentsProcessor.h>
|
||||
|
@ -100,7 +101,7 @@ static const int JSQ_TOOLBAR_ICON_HEIGHT = 22;
|
|||
static const int JSQ_TOOLBAR_ICON_WIDTH = 22;
|
||||
static const int JSQ_IMAGE_INSET = 5;
|
||||
|
||||
static NSTimeInterval const kTSMessageSentDateShowTimeInterval = 5 * 60;
|
||||
static NSTimeInterval const kTSMessageSentDateShowTimeInterval = 5 * kMinuteInterval;
|
||||
|
||||
NSString *const OWSMessagesViewControllerDidAppearNotification = @"OWSMessagesViewControllerDidAppear";
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#import "DebugUIDiskUsage.h"
|
||||
#import "OWSTableViewController.h"
|
||||
#import "Signal-Swift.h"
|
||||
#import <SignalServiceKit/NSDate+OWS.h>
|
||||
#import <SignalServiceKit/OWSOrphanedDataCleaner.h>
|
||||
#import <SignalServiceKit/TSDatabaseView.h>
|
||||
#import <SignalServiceKit/TSInteraction.h>
|
||||
|
@ -85,11 +86,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
+ (void)deleteOldMessages_3Months
|
||||
{
|
||||
NSTimeInterval kMinute = 60.f;
|
||||
NSTimeInterval kHour = 60 * kMinute;
|
||||
NSTimeInterval kDay = 24 * kHour;
|
||||
NSTimeInterval kMonth = 30 * kDay;
|
||||
[self deleteOldMessages:kMonth * 3];
|
||||
[self deleteOldMessages:kMonthInterval * 3];
|
||||
}
|
||||
|
||||
+ (void)deleteOldMessages:(NSTimeInterval)maxAgeSeconds
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#import "DebugLogger.h"
|
||||
#import "OWSScrubbingLogFormatter.h"
|
||||
#import <SignalServiceKit/NSDate+OWS.h>
|
||||
|
||||
#pragma mark Logging - Production logging wants us to write some logs to a file in case we need it for debugging.
|
||||
|
||||
|
@ -29,7 +30,7 @@
|
|||
// Logging to file, because it's in the Cache folder, they are not uploaded in iTunes/iCloud backups.
|
||||
self.fileLogger = [DDFileLogger new];
|
||||
// 24 hour rolling.
|
||||
self.fileLogger.rollingFrequency = 60 * 60 * 24;
|
||||
self.fileLogger.rollingFrequency = kDayInterval;
|
||||
// Keep last 3 days of logs - or last 3 logs (if logs rollover due to max file size).
|
||||
self.fileLogger.logFileManager.maximumNumberOfLogFiles = 3;
|
||||
// Raise the max file size per log file to 3 MB.
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#import "RegistrationViewController.h"
|
||||
#import "Signal-Swift.h"
|
||||
#import <ATAppUpdater/ATAppUpdater.h>
|
||||
#import <SignalServiceKit/NSDate+OWS.h>
|
||||
#import <SignalServiceKit/TSStorageManager.h>
|
||||
|
||||
NSString *const TSStorageManagerAppUpgradeNagCollection = @"TSStorageManagerAppUpgradeNagCollection";
|
||||
|
@ -70,10 +71,7 @@ NSString *const TSStorageManagerAppUpgradeNagDate = @"TSStorageManagerAppUpgrade
|
|||
|
||||
NSDate *lastNagDate = [[TSStorageManager sharedManager] dateForKey:TSStorageManagerAppUpgradeNagDate
|
||||
inCollection:TSStorageManagerAppUpgradeNagCollection];
|
||||
const NSTimeInterval kMinute = 60.f;
|
||||
const NSTimeInterval kHour = 60 * kMinute;
|
||||
const NSTimeInterval kDay = 24 * kHour;
|
||||
const NSTimeInterval kNagFrequency = kDay * 14;
|
||||
const NSTimeInterval kNagFrequency = kDayInterval * 14;
|
||||
BOOL canNag = (!lastNagDate || fabs(lastNagDate.timeIntervalSinceNow) > kNagFrequency);
|
||||
if (!canNag) {
|
||||
return;
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
#import "DateUtil.h"
|
||||
//
|
||||
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#define ONE_DAY_TIME_INTERVAL (double)60 * 60 * 24
|
||||
#define ONE_WEEK_TIME_INTERVAL (double)60 * 60 * 24 * 7
|
||||
#import "DateUtil.h"
|
||||
#import <SignalServiceKit/NSDate+OWS.h>
|
||||
|
||||
static NSString *const DATE_FORMAT_WEEKDAY = @"EEEE";
|
||||
|
||||
|
@ -31,11 +33,11 @@ static NSString *const DATE_FORMAT_WEEKDAY = @"EEEE";
|
|||
}
|
||||
|
||||
+ (BOOL)dateIsOlderThanOneDay:(NSDate *)date {
|
||||
return [[NSDate date] timeIntervalSinceDate:date] > ONE_DAY_TIME_INTERVAL;
|
||||
return [[NSDate date] timeIntervalSinceDate:date] > kDayInterval;
|
||||
}
|
||||
|
||||
+ (BOOL)dateIsOlderThanOneWeek:(NSDate *)date {
|
||||
return [[NSDate date] timeIntervalSinceDate:date] > ONE_WEEK_TIME_INTERVAL;
|
||||
return [[NSDate date] timeIntervalSinceDate:date] > kWeekInterval;
|
||||
}
|
||||
|
||||
+ (BOOL)date:(NSDate *)date isEqualToDateIgnoringTime:(NSDate *)anotherDate {
|
||||
|
|
Loading…
Reference in New Issue