chore(tool): fix disabling of auto-reply

Disabling of auto-reply was occuring one day too early.

Fixes #5219
This commit is contained in:
Francis Lachapelle
2020-11-26 16:18:44 -05:00
parent 7149634bd7
commit 0d81195ab3

View File

@@ -28,6 +28,7 @@
#import <GDLContentStore/GCSChannelManager.h>
#import <GDLContentStore/NSURL+GCS.h>
#import <NGExtensions/NSCalendarDate+misc.h>
#import <NGExtensions/NSNull+misc.h>
#import <NGObjWeb/WOContext+SoObjects.h>
@@ -157,9 +158,9 @@
NSString *sql, *profileURL, *user, *c_defaults;
NSURL *tableURL;
SOGoSystemDefaults *sd;
unsigned int endTime, startTime, now;
unsigned int now, endTime, startTime;
now = [[NSCalendarDate calendarDate] timeIntervalSince1970];
now = [[[NSCalendarDate calendarDate] beginOfDay] timeIntervalSince1970];
sd = [SOGoSystemDefaults sharedSystemDefaults];
profileURL = [sd profileURL];
if (!profileURL)
@@ -212,7 +213,7 @@
if ([[vacationOptions objectForKey: @"endDateEnabled"] boolValue])
{
endTime = [[vacationOptions objectForKey: @"endDate"] intValue];
if (endTime <= now)
if (endTime < now)
{
if ([self updateAutoReplyForLogin: user
withSieveUsername: theUsername