From 0d81195ab3bd792ee3b1c24ff6733e6400c236bd Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Thu, 26 Nov 2020 16:18:44 -0500 Subject: [PATCH] chore(tool): fix disabling of auto-reply Disabling of auto-reply was occuring one day too early. Fixes #5219 --- Tools/SOGoToolUpdateAutoReply.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Tools/SOGoToolUpdateAutoReply.m b/Tools/SOGoToolUpdateAutoReply.m index 34b13b645..a0b175d5b 100644 --- a/Tools/SOGoToolUpdateAutoReply.m +++ b/Tools/SOGoToolUpdateAutoReply.m @@ -28,6 +28,7 @@ #import #import +#import #import #import @@ -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