Monotone-Parent: 48706c943fa3ceb72288194c22bfec223fb4a890
Monotone-Revision: cf82a6c633ed0ff127f0f681583035b3bcc35b77 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-02-03T22:39:02 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
36a03a0e5c
commit
a5b387cfeb
|
@ -3,8 +3,16 @@
|
||||||
* OpenChange/MAPIStoreMapping.m (-unregisterURLWithID:): new
|
* OpenChange/MAPIStoreMapping.m (-unregisterURLWithID:): new
|
||||||
method for removing entries from the mapping dictionaries.
|
method for removing entries from the mapping dictionaries.
|
||||||
|
|
||||||
|
* OpenChange/MAPIStoreContext.m
|
||||||
|
(-deleteMessageWithMID:inFID:withFlags:): implemented backend method.
|
||||||
|
|
||||||
2011-02-03 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2011-02-03 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* OpenChange/MAPIStoreContext.m
|
||||||
|
(_saveOrSubmitChangesInMessageWithMID:andFlags:save:): silently
|
||||||
|
ignore "IPM.Schedule.Meeting.Request" messages from Outlook
|
||||||
|
and return a success code.
|
||||||
|
|
||||||
* SoObjects/SOGo/WOResourceManager+SOGo.m: new category module
|
* SoObjects/SOGo/WOResourceManager+SOGo.m: new category module
|
||||||
defining methods useful to the vanilla and OpenChange frontends.
|
defining methods useful to the vanilla and OpenChange frontends.
|
||||||
(-localeForLanguageNamed:): method moved from SOGo.m.
|
(-localeForLanguageNamed:): method moved from SOGo.m.
|
||||||
|
|
|
@ -142,6 +142,7 @@
|
||||||
inRows: (struct ModifyRecipientRow *) rows
|
inRows: (struct ModifyRecipientRow *) rows
|
||||||
withCount: (NSUInteger) max;
|
withCount: (NSUInteger) max;
|
||||||
- (int) deleteMessageWithMID: (uint64_t) mid
|
- (int) deleteMessageWithMID: (uint64_t) mid
|
||||||
|
inFID: (uint64_t) fid
|
||||||
withFlags: (uint8_t) flags;
|
withFlags: (uint8_t) flags;
|
||||||
- (int) releaseRecordWithFMID: (uint64_t) fmid
|
- (int) releaseRecordWithFMID: (uint64_t) fmid
|
||||||
ofTableType: (uint8_t) tableType;
|
ofTableType: (uint8_t) tableType;
|
||||||
|
|
|
@ -965,39 +965,50 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||||
[NSNumber numberWithUnsignedLongLong: mid]];
|
[NSNumber numberWithUnsignedLongLong: mid]];
|
||||||
if (messageProperties)
|
if (messageProperties)
|
||||||
{
|
{
|
||||||
messageURL = [mapping urlFromID: mid];
|
if ([[messageProperties
|
||||||
associated = [[messageProperties objectForKey: @"associated"] boolValue];
|
objectForKey: MAPIPropertyKey (PR_MESSAGE_CLASS_UNICODE)]
|
||||||
if (messageURL)
|
isEqualToString: @"IPM.Schedule.Meeting.Request"])
|
||||||
{
|
{
|
||||||
if (associated)
|
/* We silently discard invitation emails since this is already
|
||||||
message = [self lookupFAIObject: messageURL];
|
handled internally by SOGo. */
|
||||||
else
|
|
||||||
message = [self lookupObject: messageURL];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fid = [[messageProperties objectForKey: @"fid"]
|
|
||||||
unsignedLongLongValue];
|
|
||||||
message = [self _createMessageOfClass: [messageProperties objectForKey: MAPIPropertyKey (PR_MESSAGE_CLASS_UNICODE)]
|
|
||||||
associated: associated
|
|
||||||
withMID: mid inFID: fid];
|
|
||||||
}
|
|
||||||
if (message)
|
|
||||||
{
|
|
||||||
if (associated)
|
|
||||||
[faiTable cleanupCaches];
|
|
||||||
else
|
|
||||||
[messageTable cleanupCaches];
|
|
||||||
|
|
||||||
[message setMAPIProperties: messageProperties];
|
|
||||||
if (isSave)
|
|
||||||
[message MAPISave];
|
|
||||||
else
|
|
||||||
[message MAPISubmit];
|
|
||||||
rc = MAPISTORE_SUCCESS;
|
rc = MAPISTORE_SUCCESS;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
rc = MAPISTORE_ERROR;
|
{
|
||||||
|
messageURL = [mapping urlFromID: mid];
|
||||||
|
associated = [[messageProperties objectForKey: @"associated"] boolValue];
|
||||||
|
if (messageURL)
|
||||||
|
{
|
||||||
|
if (associated)
|
||||||
|
message = [self lookupFAIObject: messageURL];
|
||||||
|
else
|
||||||
|
message = [self lookupObject: messageURL];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fid = [[messageProperties objectForKey: @"fid"]
|
||||||
|
unsignedLongLongValue];
|
||||||
|
message = [self _createMessageOfClass: [messageProperties objectForKey: MAPIPropertyKey (PR_MESSAGE_CLASS_UNICODE)]
|
||||||
|
associated: associated
|
||||||
|
withMID: mid inFID: fid];
|
||||||
|
}
|
||||||
|
if (message)
|
||||||
|
{
|
||||||
|
if (associated)
|
||||||
|
[faiTable cleanupCaches];
|
||||||
|
else
|
||||||
|
[messageTable cleanupCaches];
|
||||||
|
|
||||||
|
[message setMAPIProperties: messageProperties];
|
||||||
|
if (isSave)
|
||||||
|
[message MAPISave];
|
||||||
|
else
|
||||||
|
[message MAPISubmit];
|
||||||
|
rc = MAPISTORE_SUCCESS;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
rc = MAPISTORE_ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
rc = MAPISTORE_ERR_NOT_FOUND;
|
rc = MAPISTORE_ERR_NOT_FOUND;
|
||||||
|
@ -1394,8 +1405,9 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||||
for (count = 0; count < max; count++)
|
for (count = 0; count < max; count++)
|
||||||
{
|
{
|
||||||
currentRow = rows + count;
|
currentRow = rows + count;
|
||||||
if (currentRow->RecipClass >= 0
|
|
||||||
&& currentRow->RecipClass < 3)
|
if (currentRow->RecipClass >= MAPI_ORIG
|
||||||
|
&& currentRow->RecipClass < MAPI_BCC)
|
||||||
{
|
{
|
||||||
recType = recTypes[currentRow->RecipClass];
|
recType = recTypes[currentRow->RecipClass];
|
||||||
list = [recipients objectForKey: recType];
|
list = [recipients objectForKey: recType];
|
||||||
|
@ -1418,12 +1430,56 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||||
}
|
}
|
||||||
|
|
||||||
- (int) deleteMessageWithMID: (uint64_t) mid
|
- (int) deleteMessageWithMID: (uint64_t) mid
|
||||||
|
inFID: (uint64_t) fid
|
||||||
withFlags: (uint8_t) flags
|
withFlags: (uint8_t) flags
|
||||||
{
|
{
|
||||||
[self logWithFormat: @"UNIMPLEMENTED METHOD '%s' (%d)", __FUNCTION__, __LINE__];
|
NSString *childURL, *childKey;
|
||||||
[self logWithFormat: @" mid: 0x%.16x flags: %d", mid, flags];
|
MAPIStoreTable *table;
|
||||||
|
id message;
|
||||||
|
int rc;
|
||||||
|
|
||||||
return MAPISTORE_ERROR;
|
[self logWithFormat: @"-deleteMessageWithMID: mid: 0x%.16x flags: %d", mid, flags];
|
||||||
|
|
||||||
|
childURL = [mapping urlFromID: mid];
|
||||||
|
if (childURL)
|
||||||
|
{
|
||||||
|
[self logWithFormat: @"-deleteMessageWithMID: url (%@) found for object", childURL];
|
||||||
|
|
||||||
|
childKey = [self extractChildNameFromURL: childURL
|
||||||
|
andFolderURLAt: NULL];
|
||||||
|
table = [self _tableForFID: fid andTableType: MAPISTORE_FAI_TABLE];
|
||||||
|
if ([[table cachedChildKeys] containsObject: childKey])
|
||||||
|
message = [self lookupFAIObject: childURL];
|
||||||
|
else
|
||||||
|
{
|
||||||
|
table = [self _tableForFID: fid andTableType: MAPISTORE_MESSAGE_TABLE];
|
||||||
|
if ([[table cachedChildKeys] containsObject: childKey])
|
||||||
|
message = [self lookupObject: childURL];
|
||||||
|
else
|
||||||
|
message = nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (message)
|
||||||
|
{
|
||||||
|
if ([message delete])
|
||||||
|
{
|
||||||
|
rc = MAPISTORE_ERROR;
|
||||||
|
[self logWithFormat: @"ERROR deleting object at URL: %@", childURL];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[self logWithFormat: @"sucessfully deleted object at URL: %@", childURL];
|
||||||
|
[mapping unregisterURLWithID: mid];
|
||||||
|
rc = MAPISTORE_SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
rc = MAPI_E_INVALID_OBJECT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
rc = MAPISTORE_ERR_NOT_FOUND;
|
||||||
|
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (int) releaseRecordWithFMID: (uint64_t) fmid
|
- (int) releaseRecordWithFMID: (uint64_t) fmid
|
||||||
|
|
|
@ -713,6 +713,7 @@ sogo_op_modifyrecipients(void *private_data,
|
||||||
|
|
||||||
static int
|
static int
|
||||||
sogo_op_deletemessage(void *private_data,
|
sogo_op_deletemessage(void *private_data,
|
||||||
|
uint64_t fid,
|
||||||
uint64_t mid,
|
uint64_t mid,
|
||||||
uint8_t flags)
|
uint8_t flags)
|
||||||
{
|
{
|
||||||
|
@ -729,7 +730,7 @@ sogo_op_deletemessage(void *private_data,
|
||||||
context = cContext->objcContext;
|
context = cContext->objcContext;
|
||||||
[context setupRequest];
|
[context setupRequest];
|
||||||
|
|
||||||
rc = [context deleteMessageWithMID: mid withFlags: flags];
|
rc = [context deleteMessageWithMID: mid inFID: fid withFlags: flags];
|
||||||
|
|
||||||
[context tearDownRequest];
|
[context tearDownRequest];
|
||||||
[pool release];
|
[pool release];
|
||||||
|
|
Loading…
Reference in a new issue