oc-calendar: Implement PidTagSensitivity

As described in [MS-OXCICAL] Section 2.1.3.11.20.4 by using
access CLASS iCal field.

Although Outlook does not support confidential level, it is properly
exported and imported.
pull/65/merge^2
Enrique J. Hernández Blasco 2015-02-15 18:44:47 +01:00
parent e6ba15bbae
commit 624967c60b
4 changed files with 61 additions and 5 deletions

View File

@ -1200,11 +1200,31 @@ static NSCharacterSet *hexCharacterSet = nil;
return [self getYes: data inMemCtx: memCtx];
}
- (int) getPidTagSensitivity: (void **) data // not implemented, depends on CLASS
- (int) getPidTagSensitivity: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
// normal = 0, personal?? = 1, private = 2, confidential = 3
return [self getLongZero: data inMemCtx: memCtx];
/* See [MS-OXCICAL] Section 2.1.3.11.20.4 */
uint32_t v;
NSString *accessClass;
accessClass = [event accessClass];
if (accessClass)
{
if ([accessClass isEqualToString: @"X-PERSONAL"])
v = 0x1;
else if ([accessClass isEqualToString: @"PRIVATE"])
v = 0x2;
else if ([accessClass isEqualToString: @"CONFIDENTIAL"])
v = 0x3;
else
v = 0x0; /* PUBLIC */
}
else
v = 0x0; /* PUBLIC */
*data = MAPILongValue (memCtx, v);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagImportance: (void **) data

View File

@ -365,6 +365,18 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagSensitivity: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
MAPIStoreAppointmentWrapper *appointmentWrapper;
appointmentWrapper = [self _appointmentWrapper];
if (appointmentWrapper)
return [appointmentWrapper getPidTagSensitivity: data inMemCtx: memCtx];
return [self getLongZero: data inMemCtx: memCtx];
}
- (int) getPidTagImportance: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{

View File

@ -784,7 +784,7 @@ rtf2html (NSData *compressedRTF)
return [self getLongZero: data inMemCtx: memCtx];
}
- (int) getPidTagSensitivity: (void **) data // TODO -> subclass in calendar
- (int) getPidTagSensitivity: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];

View File

@ -140,7 +140,7 @@
iCalDateTime *start, *end;
iCalTimeZone *tz;
NSTimeZone *userTimeZone;
NSString *priority;
NSString *priority, *class = nil;
NSUInteger responseStatus = 0;
NSInteger tzOffset;
SOGoUser *ownerUser;
@ -281,6 +281,30 @@
priority = @"0"; // None
[self setPriority: priority];
/* class */
/* See [MS-OXCICAL] Section 2.1.3.11.20.4 */
value = [properties objectForKey: MAPIPropertyKey(PR_SENSITIVITY)];
if (value)
{
switch ([value intValue])
{
case 1:
class = @"X-PERSONAL";
break;
case 2:
class = @"PRIVATE";
break;
case 3:
class = @"CONFIDENTIAL";
break;
default: /* 0 as well */
class = @"PUBLIC";
}
}
if (class)
[self setAccessClass: class];
/* show time as free/busy/tentative/out of office. Possible values are:
0x00000000 - olFree
0x00000001 - olTentative