diff --git a/ActiveSync/iCalToDo+ActiveSync.m b/ActiveSync/iCalToDo+ActiveSync.m index d09fda6881..e53180ebdd 100644 --- a/ActiveSync/iCalToDo+ActiveSync.m +++ b/ActiveSync/iCalToDo+ActiveSync.m @@ -54,9 +54,10 @@ @implementation iCalToDo (ActiveSync) - (NSString *) activeSyncRepresentationInContext: (WOContext *) context { NSMutableString *s; + NSArray *categories; id o; - int v; + int v, i; s = [NSMutableString string]; @@ -96,9 +97,25 @@ - (NSString *) activeSyncRepresentationInContext: (WOContext *) context // Reminder - FIXME [s appendFormat: @"%d", 0]; - // Sensitivity - FIXME - [s appendFormat: @"%d", 0]; - + if ([[self accessClass] isEqualToString: @"PRIVATE"]) + v = 2; + else if ([[self accessClass] isEqualToString: @"CONFIDENTIAL"]) + v = 3; + else + v = 0; + + categories = [self categories]; + + if ([categories count]) + { + [s appendFormat: @""]; + for (i = 0; i < [categories count]; i++) + { + [s appendFormat: @"%@", [[categories objectAtIndex: i] activeSyncRepresentationInContext: context]]; + } + [s appendFormat: @""]; + } + // Subject o = [self summary]; if ([o length]) @@ -182,6 +199,29 @@ - (void) takeActiveSyncValues: (NSDictionary *) theValues [self setPriority: @"9"]; } + // + // 0- normal, 1- personal, 2- private and 3-confidential + // + if ((o = [theValues objectForKey: @"Sensitivity"])) + { + switch ([o intValue]) + { + case 2: + [self setAccessClass: @"PRIVATE"]; + break; + case 3: + [self setAccessClass: @"CONFIDENTIAL"]; + break; + case 0: + case 1: + default: + [self setAccessClass: @"PUBLIC"]; + } + } + + // Categories + if ((o = [theValues objectForKey: @"Categories"]) && [o length]) + [self setCategories: o]; if ((o = [theValues objectForKey: @"ReminderTime"])) {