From 1648d063af91d2606a83f3e68852a84131982189 Mon Sep 17 00:00:00 2001 From: C Robert Date: Mon, 28 Sep 2009 13:25:14 +0000 Subject: [PATCH] Fixed errors in ab import/export Monotone-Parent: e5b6580e3ea6df5bbc9bde0db8b2a350b69e3eb8 Monotone-Revision: 2494a7d12f52699f7ee338f8403ab926c0c118ab Monotone-Author: crobert@inverse.ca Monotone-Date: 2009-09-28T13:25:14 Monotone-Branch: ca.inverse.sogo --- .../Appointments/SOGoAppointmentFolder.m | 1 + UI/Contacts/UIxContactFolderActions.m | 20 +++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 6dcaa6007..adb3e1d73 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -3195,6 +3195,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir [event setUid: uid]; object = [SOGoAppointmentObject objectWithName: uid inContainer: self]; + [object setIsNew: YES]; content = [NSString stringWithFormat: @"BEGIN:VCALENDAR\n%@\nEND:VCALENDAR", [event versitString]]; diff --git a/UI/Contacts/UIxContactFolderActions.m b/UI/Contacts/UIxContactFolderActions.m index 27de79d4b..94a47e541 100644 --- a/UI/Contacts/UIxContactFolderActions.m +++ b/UI/Contacts/UIxContactFolderActions.m @@ -207,24 +207,24 @@ - (BOOL) importVcard: (NGVCard *) card { - NSString *uid, *name; + NSString *uid; SOGoContactGCSFolder *folder; - NSException *ex; + SOGoContactGCSEntry *contact; BOOL rc = NO; if (card) { folder = [self clientObject]; uid = [folder globallyUniqueObjectId]; - name = [NSString stringWithFormat: @"%@.vcf", uid]; + [card setUid: uid]; - ex = [[folder ocsFolder] writeContent: [card versitString] - toName: name - baseVersion: 0]; - if (ex) - NSLog (@"write failed: %@", ex); - else - rc = YES; + contact = [SOGoContactGCSEntry objectWithName: uid + inContainer: folder]; + [contact setIsNew: YES]; + + [contact saveContentString: [card versitString]]; + + rc = YES; } return rc;