(fix) avoid EAS bday offset (fixes #3518) + small fix in previous commit

pull/189/merge
Ludovic Marcotte 2016-02-11 15:04:44 -05:00
parent 9d6e779bb0
commit 4f1ce3f2df
2 changed files with 18 additions and 4 deletions

View File

@ -46,6 +46,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "NSDate+ActiveSync.h"
#include "NSString+ActiveSync.h"
#import <NGObjWeb/WOContext+SoObjects.h>
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserDefaults.h>
@implementation NGVCard (ActiveSync)
//
@ -233,7 +238,16 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Other, less important fields
if ((o = [self birthday]))
[s appendFormat: @"<Birthday xmlns=\"Contacts:\">%@</Birthday>", [o activeSyncRepresentationInContext: context]];
{
NSTimeZone *userTimeZone;
userTimeZone = [[[context activeUser] userDefaults] timeZone];
[s appendFormat: @"<Birthday xmlns=\"Contacts:\">%@</Birthday>",
[[o dateByAddingYears: 0 months: 0 days: 0
hours: 0 minutes: 0
seconds: ([userTimeZone secondsFromGMTForDate: o])*-1]
activeSyncRepresentationInContext: context]];
}
if ((o = [self note]))
{

View File

@ -1178,7 +1178,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
a = [[realCollectionId componentsSeparatedByString: @"/"] mutableCopy];
[a autorelease]
[a autorelease];
pathToPart = [a lastObject];
[a removeLastObject];
messageName = [a lastObject];
@ -1389,8 +1389,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
int p;
a = [[realCollectionId componentsSeparatedByString: @"/"] mutableCopy];
[a autorelease]
pathToPart = [a lastObject];
[a autorelease];
pathToPart = [a lastObject];
[a removeLastObject];
messageName = [a lastObject];
[a removeLastObject];