Skip to content

Commit

Permalink
Categories and privacy fixes for bug #3022
Browse files Browse the repository at this point in the history
  • Loading branch information
extrafu committed Dec 16, 2014
1 parent 9cb1f80 commit e79ea75
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions ActiveSync/iCalEvent+ActiveSync.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ - (int) _attendeeStatus: (iCalPerson *) attendee
- (NSString *) activeSyncRepresentationInContext: (WOContext *) context
{
NSMutableString *s;
NSArray *attendees;
NSArray *attendees, *categories;

iCalPerson *organizer, *attendee;
iCalTimeZone *tz;
id o;

int v;
int v, i;

NSTimeZone *userTimeZone;
userTimeZone = [[[context activeUser] userDefaults] timeZone];
Expand Down Expand Up @@ -223,12 +223,25 @@ - (NSString *) activeSyncRepresentationInContext: (WOContext *) context
// Sensitivity
if ([[self accessClass] isEqualToString: @"PRIVATE"])
v = 2;
if ([[self accessClass] isEqualToString: @"CONFIDENTIAL"])
else if ([[self accessClass] isEqualToString: @"CONFIDENTIAL"])
v = 3;
else
v = 0;

[s appendFormat: @"<Sensitivity xmlns=\"Calendar:\">%d</Sensitivity>", v];

categories = [self categories];

if ([categories count])
{
[s appendFormat: @"<Categories xmlns=\"Calendar:\">"];
for (i = 0; i < [categories count]; i++)
{
[s appendFormat: @"<Category xmlns=\"Calendar:\">%@</Category>", [[categories objectAtIndex: i] activeSyncRepresentationInContext: context]];
}
[s appendFormat: @"</Categories>"];
}


// Reminder -- http://msdn.microsoft.com/en-us/library/ee219691(v=exchg.80).aspx
// TODO: improve this to handle more alarm types
Expand Down Expand Up @@ -337,7 +350,7 @@ - (void) takeActiveSyncValues: (NSDictionary *) theValues
//
// 0- normal, 1- personal, 2- private and 3-confidential
//
if ((o = [theValues objectForKey: @"Sensitivy"]))
if ((o = [theValues objectForKey: @"Sensitivity"]))
{
switch ([o intValue])
{
Expand All @@ -353,7 +366,11 @@ - (void) takeActiveSyncValues: (NSDictionary *) theValues
[self setAccessClass: @"PUBLIC"];
}
}


// Categories
if ((o = [theValues objectForKey: @"Categories"]) && [o length])
[self setCategories: o];

// We ignore TimeZone sent by mobile devices for now.
// Some Windows devices don't send during event updates.
//if ((o = [theValues objectForKey: @"TimeZone"]))
Expand Down

0 comments on commit e79ea75

Please sign in to comment.