Skip to content

Commit

Permalink
chore(tool): fix disabling of auto-reply
Browse files Browse the repository at this point in the history
Disabling of auto-reply was occuring one day too early.

Fixes #5219
  • Loading branch information
cgx committed Nov 26, 2020
1 parent 7149634 commit 0d81195
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Tools/SOGoToolUpdateAutoReply.m
Expand Up @@ -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>
Expand Down Expand Up @@ -157,9 +158,9 @@ - (void) updateAutoReplyWithUsername: (NSString *) theUsername
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)
Expand Down Expand Up @@ -212,7 +213,7 @@ - (void) updateAutoReplyWithUsername: (NSString *) theUsername
if ([[vacationOptions objectForKey: @"endDateEnabled"] boolValue])
{
endTime = [[vacationOptions objectForKey: @"endDate"] intValue];
if (endTime <= now)
if (endTime < now)
{
if ([self updateAutoReplyForLogin: user
withSieveUsername: theUsername
Expand Down

0 comments on commit 0d81195

Please sign in to comment.