[s appendString:[calendar isNotNull] ? [calendar prodId] : @"SOGo/0.9"];
[s appendString:@"\n"];
- [s appendString:@"\nVERSION:"];
+ [s appendString:@"VERSION:"];
[s appendString:[calendar isNotNull] ? [calendar version] : @"2.0"];
[s appendString:@"\n"];
}
[s appendString:@"DTSTART:"];
[s appendString:[[_apt startDate] icalString]];
[s appendString:@"\n"];
+
if ([_apt hasEndDate]) {
[s appendString:@"DTEND:"];
[s appendString:[[_apt endDate] icalString]];
+ [s appendString:@"\n"];
}
if ([_apt hasDuration]) {
[s appendString:@"DURATION:"];
[s appendString:[event duration]];
+ [s appendString:@"\n"];
}
- [s appendString:@"\n"];
[s appendString:@"STATUS:"];
[s appendString:[_apt status]];
[s appendString:@"\n"];
/* what's all this? */
- [s appendString:@"TRANSP:OPAQUE"]; /* transparency */
- [s appendString:@"\nCLASS:PRIVATE"]; /* classification [like 'top secret'] */
- [s appendString:@"\n"];
+ [s appendString:@"TRANSP:OPAQUE\n"]; /* transparency */
+ [s appendString:@"CLASS:PRIVATE\n"]; /* classification [like 'top secret'] */
[self addOrganizer:[_apt organizer] toString:s];
[self addAttendees:[_apt attendees] toString:s];
- (NSString *)stringForAppointment:(SOGoAppointment *)_apt {
NSMutableString *s;
+ if ([[_apt uid] length] == 0) {
+ [self logWithFormat:@"WARNING: got apt without uid, rejecting iCal gen."];
+ return nil;
+ }
+ if ([[[_apt startDate] icalString] length] == 0) {
+ [self logWithFormat:
+ @"WARNING: got apt without startdate, rejecting iCal gen."];
+ return nil;
+ }
+
/* assume length of 1K - reasonable ? */
s = [NSMutableString stringWithCapacity:1024];
[self addPreambleForAppointment:_apt toString:s];