oc-mail: Store request properties

Save them in extra properties from folder container.

This is required because the client once a request is accepted
or denied sets these two properties and save the message again.
As we cannot modify an IMAP message, we use this utility.

See [MS-OXSHARE] Section 3.1.4.3 for details.
This commit is contained in:
Enrique J. Hernández Blasco
2015-03-18 23:57:33 +01:00
parent a663fdd260
commit 514b1c03be
3 changed files with 90 additions and 8 deletions

View File

@@ -65,7 +65,7 @@
@class iCalCalendar, iCalEvent;
static Class NSExceptionK;
static Class NSExceptionK, MAPIStoreSharingMessageK;
@interface NSString (MAPIStoreMIME)
@@ -108,6 +108,7 @@ static Class NSExceptionK;
+ (void) initialize
{
NSExceptionK = [NSException class];
MAPIStoreSharingMessageK = [MAPIStoreSharingMessage class];
}
- (id) init
@@ -267,7 +268,8 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data)
a sharing object is a proxy in a mail message */
sharingMessage = [[MAPIStoreSharingMessage alloc]
initWithMailHeaders: [sogoObject mailHeaders]
andConnectionInfo: [[self context] connectionInfo]];
andConnectionInfo: [[self context] connectionInfo]
fromMessage: self];
[self addProxy: sharingMessage];
[sharingMessage release];
}
@@ -1641,6 +1643,21 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data)
bodySetup = YES;
}
- (MAPIStoreSharingMessage *) _sharingObject
{
/* Get the sharing object if available */
NSUInteger i, max;
id proxy;
max = [proxies count];
for (i = 0; i < max; i++) {
proxy = [proxies objectAtIndex: i];
if ([proxy isKindOfClass: MAPIStoreSharingMessageK])
return proxy;
}
return nil;
}
- (void) save: (TALLOC_CTX *) memCtx
{
NSNumber *value;
@@ -1654,6 +1671,11 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data)
else /* 0: unflagged, 1: follow up complete */
[sogoObject removeFlags: @"\\Flagged"];
}
if (mailIsSharingObject)
[[self _sharingObject] saveWithMessage: self
andSOGoObject: sogoObject];
}
@end