diff --git a/ActiveSync/iCalToDo+ActiveSync.m b/ActiveSync/iCalToDo+ActiveSync.m index 503e6c760..127e65e30 100644 --- a/ActiveSync/iCalToDo+ActiveSync.m +++ b/ActiveSync/iCalToDo+ActiveSync.m @@ -47,31 +47,40 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - (NSString *) activeSyncRepresentation { NSMutableString *s; + id o; + int v; s = [NSMutableString string]; // Complete - NSCalendarDate *completed; - completed = [self completed]; - [s appendFormat: @"%d", (completed ? 1 : 0)]; + o = [self completed]; + [s appendFormat: @"%d", (o ? 1 : 0)]; // DateCompleted - if (completed) - [s appendFormat: @"%@", [completed activeSyncRepresentation]]; + if (o) + [s appendFormat: @"%@", [o activeSyncRepresentation]]; + + // Start date + if ((o = [self startDate])) + { + [s appendFormat: @"%@", [o activeSyncRepresentation]]; + [s appendFormat: @"%@", [o activeSyncRepresentation]]; + } + // Due date - NSCalendarDate *due; - due = [self due]; - if (due) - [s appendFormat: @"%@", [due activeSyncRepresentation]]; + if ((o = [self due])) + { + [s appendFormat: @"%@", [o activeSyncRepresentation]]; + [s appendFormat: @"%@", [o activeSyncRepresentation]]; + } // Importance - NSString *priority; - priority = [self priority]; - if ([priority isEqualToString: @"9"]) + o = [self priority]; + if ([o isEqualToString: @"9"]) v = 0; - else if ([priority isEqualToString: @"1"]) + else if ([o isEqualToString: @"1"]) v = 2; else v = 1; @@ -83,13 +92,21 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Sensitivity - FIXME [s appendFormat: @"%d", 0]; - // UTCStartDate - FIXME - if ([self startDate]) - [s appendFormat: @"%@", [[self startDate] activeSyncRepresentation]]; - // Subject [s appendFormat: @"%@", [self summary]]; + if ((o = [self comment])) + { + [s appendString: @""]; + [s appendFormat: @"%d", 1]; + [s appendFormat: @"%d", [o length]]; + [s appendFormat: @"%d", 0]; + [s appendFormat: @"%@", o]; + [s appendString: @""]; + } + + return s; + return s; }