Monotone-Parent: 3bc92406543042dce09f1c096eb8a19107b42eb2

Monotone-Revision: 0a2c134a89861c564e6bc97bf789ca4a39adcf4a

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-07-20T15:21:11
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2012-07-20 15:21:11 +00:00
parent 63c2d62b0b
commit 649b6fb90f
6 changed files with 103 additions and 44 deletions

View File

@@ -962,10 +962,11 @@ sogo_message_submit (void *message_object, enum SubmitFlags flags)
}
static enum mapistore_error
sogo_message_attachment_open_embedded_message
(void *attachment_object, enum OpenEmbeddedMessage_OpenModeFlags mode,
TALLOC_CTX *mem_ctx, void **message_object, uint64_t *midP,
struct mapistore_message **msg)
sogo_message_attachment_open_embedded_message (void *attachment_object,
TALLOC_CTX *mem_ctx,
void **message_object,
uint64_t *midP,
struct mapistore_message **msg)
{
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
@@ -982,7 +983,6 @@ sogo_message_attachment_open_embedded_message
GSRegisterCurrentThread ();
pool = [NSAutoreleasePool new];
rc = [attachment openEmbeddedMessage: &message
inMode: mode
withMID: midP
withMAPIStoreMsg: msg
inMemCtx: mem_ctx];
@@ -999,6 +999,42 @@ sogo_message_attachment_open_embedded_message
return rc;
}
static enum mapistore_error
sogo_message_attachment_create_embedded_message (void *attachment_object,
TALLOC_CTX *mem_ctx,
void **message_object,
struct mapistore_message **msg)
{
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreAttachment *attachment;
MAPIStoreEmbeddedMessage *message;
int rc;
DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__));
if (attachment_object)
{
wrapper = attachment_object;
attachment = wrapper->instance;
GSRegisterCurrentThread ();
pool = [NSAutoreleasePool new];
rc = [attachment createEmbeddedMessage: &message
withMAPIStoreMsg: msg
inMemCtx: mem_ctx];
if (rc == MAPISTORE_SUCCESS)
*message_object = [message tallocWrapper: mem_ctx];
[pool release];
GSUnregisterCurrentThread ();
}
else
{
rc = sogo_backend_unexpected_error();
}
return rc;
}
static enum mapistore_error sogo_table_get_available_properties(void *table_object,
TALLOC_CTX *mem_ctx, struct SPropTagArray **propertiesP)
{
@@ -1386,6 +1422,7 @@ int mapistore_init_backend(void)
backend.message.get_attachment_table = sogo_message_get_attachment_table;
backend.message.open_attachment = sogo_message_open_attachment;
backend.message.open_embedded_message = sogo_message_attachment_open_embedded_message;
backend.message.create_embedded_message = sogo_message_attachment_create_embedded_message;
backend.message.get_message_data = sogo_message_get_message_data;
backend.message.modify_recipients = sogo_message_modify_recipients;
backend.message.set_read_flag = sogo_message_set_read_flag;