From 7d7961ffcfdf9750dfdadd4fa81efc8df2992e01 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Fri, 2 May 2014 13:35:21 -0400 Subject: [PATCH] Fix for bug #2492 --- NEWS | 1 + SoObjects/SOGo/SOGoGCSFolder.m | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 67ef47d14..2d1eda8aa 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ Bug fixes - fixed display of events having a category with HTML entities (#2703) - fixed display of images in CSS background (#2437) - fixed limitation of Sieve script size (#2745) + - fixed sync-token generation when no change was returned (#2492) 2.2.3 (2014-04-03) ------------------ diff --git a/SoObjects/SOGo/SOGoGCSFolder.m b/SoObjects/SOGo/SOGoGCSFolder.m index 135a07dc0..d67491f33 100644 --- a/SoObjects/SOGo/SOGoGCSFolder.m +++ b/SoObjects/SOGo/SOGoGCSFolder.m @@ -1,9 +1,7 @@ /* SOGoGCSFolder.m - this file is part of SOGo * * Copyright (C) 2004-2005 SKYRIX Software AG - * Copyright (C) 2006-2012 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2006-2014 Inverse inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1358,11 +1356,15 @@ static NSArray *childRecordFields = nil; } NSZoneFree (NULL, selectors); - + + /* If we haven't gotten any result to return, let's use the previously + supplied sync-token */ + if (max == 0) + newToken = syncToken; /* If the most recent c_lastmodified is "now", we need to return "now - 1" in order to make sure during the next sync that every records that might get added at the same moment are not lost. */ - if (!newToken || newToken == now) + else if (!newToken || newToken == now) newToken = now - 1; newTokenStr = [NSString stringWithFormat: @"%d", newToken];