From 54b3b042c551b976c2bc3070ef50a2f041b5b46e Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 12 Jul 2011 21:44:38 +0000 Subject: [PATCH 1/4] Monotone-Parent: 8e645f6ce572b9b56929f17f32c93a52e98cef27 Monotone-Revision: 068bea34405b0256117d10e651c8cbc5279e8821 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-07-12T21:44:38 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++ OpenChange/MAPIStoreContext.h | 11 ----- OpenChange/MAPIStoreContext.m | 85 ----------------------------------- OpenChange/MAPIStoreSOGo.m | 64 -------------------------- 4 files changed, 4 insertions(+), 160 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7ea359dde..ada561243 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,10 @@ 2011-07-12 Wolfgang Sourdeau + * OpenChange/MAPIStoreSOGo.m: (sogo_op_get_table_property) + (sogo_op_get_available_table_properties): removed obsolete + methods. + * OpenChange/MAPIStoreCalendarMessageTable.m, OpenChange/MAPIStoreContactsMessageTable.m, OpenChange/MAPIStoreFAIMessageTable.m, diff --git a/OpenChange/MAPIStoreContext.h b/OpenChange/MAPIStoreContext.h index b2e7e408e..680492b23 100644 --- a/OpenChange/MAPIStoreContext.h +++ b/OpenChange/MAPIStoreContext.h @@ -119,14 +119,6 @@ withFID: (uint64_t) fid andTableType: (uint8_t) type getTableStatus: (uint8_t *) tableStatus; -- (enum MAPISTATUS) getTableProperty: (void **) data - withTag: (enum MAPITAGS) proptag - atPosition: (uint32_t) pos - withTableType: (uint8_t) tableType - andQueryType: (enum table_query_type) queryType - inFID: (uint64_t) fid - inMemCtx: (TALLOC_CTX *) memCtx; - - (int) mkDir: (struct SRow *) aRow withFID: (uint64_t) fid inParentFID: (uint64_t) parentFID; @@ -153,9 +145,6 @@ inRow: (struct SRow *) aRow withMID: (uint64_t) fmid inMemCtx: (TALLOC_CTX *) memCtx; -- (int) getAvailableProperties: (struct SPropTagArray **) propertiesP - ofTableType: (uint8_t) type - inMemCtx: (TALLOC_CTX *) memCtx; - (int) setPropertiesWithFMID: (uint64_t) fmid ofTableType: (uint8_t) tableType inRow: (struct SRow *) aRow; diff --git a/OpenChange/MAPIStoreContext.m b/OpenChange/MAPIStoreContext.m index 5f1c17ee6..bc2f6973d 100644 --- a/OpenChange/MAPIStoreContext.m +++ b/OpenChange/MAPIStoreContext.m @@ -676,91 +676,6 @@ _prepareContextClass (struct mapistore_context *newMemCtx, return MAPISTORE_SUCCESS; } -- (enum MAPISTATUS) getTableProperty: (void **) data - withTag: (enum MAPITAGS) propTag - atPosition: (uint32_t) pos - withTableType: (uint8_t) tableType - andQueryType: (enum table_query_type) queryType - inFID: (uint64_t) fid - inMemCtx: (TALLOC_CTX *) memCtx -{ - NSString *folderURL; - MAPIStoreTable *table; - MAPIStoreObject *object; - const char *propName; - int rc; - - // [self errorWithFormat: @"%s: obsolete method", __FUNCTION__]; - - folderURL = [mapping urlFromID: fid]; - if (folderURL) - { - table = [self _tableForFID: fid andTableType: tableType]; - *data = NULL; - object = [table childAtRowID: pos forQueryType: queryType]; - if (object) - { - rc = [object getProperty: data withTag: propTag inMemCtx: memCtx]; - if (rc == MAPISTORE_ERR_NOT_FOUND) - rc = MAPI_E_NOT_FOUND; - else if (rc == MAPISTORE_ERR_NO_MEMORY) - rc = MAPI_E_NOT_ENOUGH_MEMORY; - else if (rc == MAPISTORE_SUCCESS && *data == NULL) - { - propName = get_proptag_name (propTag); - if (!propName) - propName = ""; - - [self errorWithFormat: @"both 'success' and NULL data" - @" returned for proptag %s(0x%.8x)", - propName, propTag]; - rc = MAPI_E_NOT_FOUND; - } - } - else - rc = MAPI_E_INVALID_OBJECT; - } - else - { - [self errorWithFormat: @"No url found for FID: %lld", fid]; - rc = MAPI_E_INVALID_OBJECT; - } - - return rc; -} - -- (int) getAvailableProperties: (struct SPropTagArray **) propertiesP - ofTableType: (uint8_t) type - inMemCtx: (TALLOC_CTX *) memCtx -{ - int rc = MAPISTORE_SUCCESS; - - switch (type) - { - case MAPISTORE_FOLDER_TABLE: - [[baseFolder class] getAvailableProperties: propertiesP inMemCtx: memCtx]; - break; - case MAPISTORE_MESSAGE_TABLE: - [[baseFolder messageClass] getAvailableProperties: propertiesP inMemCtx: memCtx]; - break; - case MAPISTORE_FAI_TABLE: - [MAPIStoreFAIMessage getAvailableProperties: propertiesP inMemCtx: memCtx]; - break; - case MAPISTORE_RULE_TABLE: - [self errorWithFormat: @"%s: rules not handled yet", - __PRETTY_FUNCTION__]; - rc = MAPISTORE_ERROR; - break; - case MAPISTORE_ATTACHMENT_TABLE: - [self errorWithFormat: @"%s: attachments not handled yet", - __PRETTY_FUNCTION__]; - rc = MAPISTORE_ERROR; - break; - } - - return rc; -} - - (int) openMessage: (struct mapistore_message *) msg withMID: (uint64_t) mid inFID: (uint64_t) fid diff --git a/OpenChange/MAPIStoreSOGo.m b/OpenChange/MAPIStoreSOGo.m index 4737ef46f..d801d3825 100644 --- a/OpenChange/MAPIStoreSOGo.m +++ b/OpenChange/MAPIStoreSOGo.m @@ -426,68 +426,6 @@ sogo_op_readdir_count(void *private_data, return rc; } - -static int -sogo_op_get_table_property(void *private_data, - TALLOC_CTX *mem_ctx, - uint64_t fid, - uint8_t table_type, - enum table_query_type query_type, - uint32_t pos, - uint32_t proptag, - void **data) -{ - NSAutoreleasePool *pool; - sogo_context *cContext; - MAPIStoreContext *context; - int rc; - - // DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__)); - - pool = [NSAutoreleasePool new]; - - cContext = private_data; - context = cContext->objcContext; - [context setupRequest]; - - rc = [context getTableProperty: data withTag: proptag atPosition: pos - withTableType: table_type andQueryType: query_type - inFID: fid inMemCtx: mem_ctx]; - - [context tearDownRequest]; - [pool release]; - - return rc; -} - -static int -sogo_op_get_available_table_properties(void *private_data, TALLOC_CTX *mem_ctx, - uint8_t type, - struct SPropTagArray **propertiesP) -{ - NSAutoreleasePool *pool; - sogo_context *cContext; - MAPIStoreContext *context; - int rc; - - DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__)); - - pool = [NSAutoreleasePool new]; - - cContext = private_data; - context = cContext->objcContext; - [context setupRequest]; - - rc = [context getAvailableProperties: propertiesP - ofTableType: type - inMemCtx: mem_ctx]; - - [context tearDownRequest]; - [pool release]; - - return rc; -} - static int sogo_op_openmessage(void *private_data, TALLOC_CTX *mem_ctx, @@ -1235,8 +1173,6 @@ int mapistore_init_backend(void) backend.op_opendir = sogo_op_opendir; backend.op_closedir = sogo_op_closedir; backend.op_readdir_count = sogo_op_readdir_count; - backend.op_get_table_property = sogo_op_get_table_property; - backend.op_get_available_table_properties = sogo_op_get_available_table_properties; backend.op_set_restrictions = sogo_op_set_restrictions; backend.op_set_sort_order = sogo_op_set_sort_order; backend.op_openmessage = sogo_op_openmessage; From d999da2ad12ea58ee149f03a3fb2747e5038b1c1 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 12 Jul 2011 21:47:20 +0000 Subject: [PATCH 2/4] Monotone-Parent: 068bea34405b0256117d10e651c8cbc5279e8821 Monotone-Revision: 52f97967a551afb1284c9e0105d60c36d40f471a Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-07-12T21:47:20 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 +++ OpenChange/MAPIStoreFSMessage.m | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ada561243..8212eaf47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,9 @@ 2011-07-12 Wolfgang Sourdeau + * OpenChange/MAPIStoreFSMessage.m + (+getAvailableProperties:inMemCtx:): added memCtx parameter. + * OpenChange/MAPIStoreSOGo.m: (sogo_op_get_table_property) (sogo_op_get_available_table_properties): removed obsolete methods. diff --git a/OpenChange/MAPIStoreFSMessage.m b/OpenChange/MAPIStoreFSMessage.m index 70ac53fc0..e73b7ca16 100644 --- a/OpenChange/MAPIStoreFSMessage.m +++ b/OpenChange/MAPIStoreFSMessage.m @@ -38,6 +38,7 @@ @implementation MAPIStoreFSMessage + (int) getAvailableProperties: (struct SPropTagArray **) propertiesP + inMemCtx: (TALLOC_CTX *) memCtx { struct SPropTagArray *properties; NSUInteger count; @@ -45,7 +46,7 @@ 0x683f0102, 0x68410003, 0x68420102, 0x68450102, 0x68460003 }; - properties = talloc_zero (NULL, struct SPropTagArray); + properties = talloc_zero (memCtx, struct SPropTagArray); properties->cValues = MAPIStoreSupportedPropertiesCount + 8; properties->aulPropTag = talloc_array (NULL, enum MAPITAGS, MAPIStoreSupportedPropertiesCount + 8); From f47d22f19ff6306306826a5ac4b89fb2c0ab7853 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 12 Jul 2011 21:59:04 +0000 Subject: [PATCH 3/4] Monotone-Parent: 52f97967a551afb1284c9e0105d60c36d40f471a Monotone-Revision: c8fd48b8c8d9b7448bdeed036dda351e575cb5df Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-07-12T21:59:04 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 ++- OpenChange/MAPIStoreContext.h | 8 ---- OpenChange/MAPIStoreContext.m | 32 ---------------- OpenChange/MAPIStoreSOGo.m | 70 ----------------------------------- 4 files changed, 3 insertions(+), 112 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8212eaf47..f7967ba22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,8 +21,9 @@ (+getAvailableProperties:inMemCtx:): added memCtx parameter. * OpenChange/MAPIStoreSOGo.m: (sogo_op_get_table_property) - (sogo_op_get_available_table_properties): removed obsolete - methods. + (sogo_op_get_available_table_properties) + (sogo_op_set_restrictions,sogo_op_set_sort_order): removed + obsolete methods. * OpenChange/MAPIStoreCalendarMessageTable.m, OpenChange/MAPIStoreContactsMessageTable.m, diff --git a/OpenChange/MAPIStoreContext.h b/OpenChange/MAPIStoreContext.h index 680492b23..18d521bf9 100644 --- a/OpenChange/MAPIStoreContext.h +++ b/OpenChange/MAPIStoreContext.h @@ -111,14 +111,6 @@ byName: (const char *) foldername inParentFID: (uint64_t) parent_fid; -- (int) setRestrictions: (const struct mapi_SRestriction *) res - withFID: (uint64_t) fid - andTableType: (uint8_t) tableType - getTableStatus: (uint8_t *) tableStatus; -- (int) setSortOrder: (const struct SSortOrderSet *) set - withFID: (uint64_t) fid andTableType: (uint8_t) type - getTableStatus: (uint8_t *) tableStatus; - - (int) mkDir: (struct SRow *) aRow withFID: (uint64_t) fid inParentFID: (uint64_t) parentFID; diff --git a/OpenChange/MAPIStoreContext.m b/OpenChange/MAPIStoreContext.m index bc2f6973d..a6dc2f98a 100644 --- a/OpenChange/MAPIStoreContext.m +++ b/OpenChange/MAPIStoreContext.m @@ -644,38 +644,6 @@ _prepareContextClass (struct mapistore_context *newMemCtx, // [self logWithFormat: @"%@ --> %@", resStr, MAPIStringForRestrictionState (state)]; // } -- (int) setRestrictions: (const struct mapi_SRestriction *) res - withFID: (uint64_t) fid - andTableType: (uint8_t) tableType - getTableStatus: (uint8_t *) tableStatus -{ - MAPIStoreTable *table; - - [self errorWithFormat: @"%s: obsolete method", __FUNCTION__]; - - table = [self _tableForFID: fid andTableType: tableType]; - [table setRestrictions: res]; - // FIXME: we should not flush the caches if the restrictions matches - [table cleanupCaches]; - - return MAPISTORE_SUCCESS; -} - -- (int) setSortOrder: (const struct SSortOrderSet *) set - withFID: (uint64_t) fid andTableType: (uint8_t) type - getTableStatus: (uint8_t *) tableStatus -{ - MAPIStoreTable *table; - - [self errorWithFormat: @"%s: obsolete method", __FUNCTION__]; - - table = [self _tableForFID: fid andTableType: type]; - [table setSortOrder: set]; - [table cleanupCaches]; - - return MAPISTORE_SUCCESS; -} - - (int) openMessage: (struct mapistore_message *) msg withMID: (uint64_t) mid inFID: (uint64_t) fid diff --git a/OpenChange/MAPIStoreSOGo.m b/OpenChange/MAPIStoreSOGo.m index d801d3825..d7048e3a5 100644 --- a/OpenChange/MAPIStoreSOGo.m +++ b/OpenChange/MAPIStoreSOGo.m @@ -656,74 +656,6 @@ sogo_op_deletemessage(void *private_data, return rc; } -static int -sogo_op_set_restrictions (void *private_data, uint64_t fid, uint8_t type, - struct mapi_SRestriction *res, uint8_t *tableStatus) -{ - NSAutoreleasePool *pool; - sogo_context *cContext; - MAPIStoreContext *context; - int rc; - - DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__)); - - pool = [NSAutoreleasePool new]; - - cContext = private_data; - context = cContext->objcContext; - if (context) - { - [context setupRequest]; - - rc = [context setRestrictions: res - withFID: fid andTableType: type - getTableStatus: tableStatus]; - - [context tearDownRequest]; - [pool release]; - } - else - { - NSLog (@" UNEXPECTED WEIRDNESS: RECEIVED NO CONTEXT"); - rc = MAPI_E_NOT_FOUND; - } - - return rc; -} - -static int -sogo_op_set_sort_order (void *private_data, uint64_t fid, uint8_t type, - struct SSortOrderSet *set, uint8_t *tableStatus) -{ - NSAutoreleasePool *pool; - sogo_context *cContext; - MAPIStoreContext *context; - int rc; - - DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__)); - - pool = [NSAutoreleasePool new]; - - cContext = private_data; - context = cContext->objcContext; - if (context) - { - [context setupRequest]; - rc = [context setSortOrder: set - withFID: fid andTableType: type - getTableStatus: tableStatus]; - [context tearDownRequest]; - [pool release]; - } - else - { - NSLog (@" UNEXPECTED WEIRDNESS: RECEIVED NO CONTEXT"); - rc = MAPI_E_NOT_FOUND; - } - - return rc; -} - /** proof of concept */ @@ -1173,8 +1105,6 @@ int mapistore_init_backend(void) backend.op_opendir = sogo_op_opendir; backend.op_closedir = sogo_op_closedir; backend.op_readdir_count = sogo_op_readdir_count; - backend.op_set_restrictions = sogo_op_set_restrictions; - backend.op_set_sort_order = sogo_op_set_sort_order; backend.op_openmessage = sogo_op_openmessage; backend.op_createmessage = sogo_op_createmessage; backend.op_modifyrecipients = sogo_op_modifyrecipients; From 3eb03e75ef686adec20482328ceb0dc4c261261b Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 13 Jul 2011 13:36:07 +0000 Subject: [PATCH 4/4] Monotone-Parent: b603e0a3e30f24330cb136471c6dc9798ffe1ba5 Monotone-Revision: cf0bf1453ddf93b100f4c44465b8b4ede251cf8e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-07-13T13:36:07 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ OpenChange/MAPIStoreContext.h | 4 ---- OpenChange/MAPIStoreContext.m | 10 ---------- OpenChange/MAPIStoreSOGo.m | 26 -------------------------- 4 files changed, 5 insertions(+), 40 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4f5e10a1d..9f61bde74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-07-13 Wolfgang Sourdeau + + * OpenChange/MAPIStoreSOGo.m (sogo_op_get_fid_by_name): removed + obsolete method. + 2011-07-12 Francis Lachapelle * UI/MailerUI/UIxMailFolderActions.m (-batchDeleteAction): we diff --git a/OpenChange/MAPIStoreContext.h b/OpenChange/MAPIStoreContext.h index 18d521bf9..99909675c 100644 --- a/OpenChange/MAPIStoreContext.h +++ b/OpenChange/MAPIStoreContext.h @@ -107,10 +107,6 @@ withTableType: (uint8_t) tableType inMemCtx: (TALLOC_CTX *) memCtx; -- (int) getFID: (uint64_t *) fid - byName: (const char *) foldername - inParentFID: (uint64_t) parent_fid; - - (int) mkDir: (struct SRow *) aRow withFID: (uint64_t) fid inParentFID: (uint64_t) parentFID; diff --git a/OpenChange/MAPIStoreContext.m b/OpenChange/MAPIStoreContext.m index a6dc2f98a..ca11e240e 100644 --- a/OpenChange/MAPIStoreContext.m +++ b/OpenChange/MAPIStoreContext.m @@ -985,16 +985,6 @@ _prepareContextClass (struct mapistore_context *newMemCtx, return rc; } -- (int) getFID: (uint64_t *) fid - byName: (const char *) foldername - inParentFID: (uint64_t) parent_fid -{ - [self logWithFormat: @"METHOD '%s' (%d) -- foldername: %s, parent_fid: %lld", - __FUNCTION__, __LINE__, foldername, parent_fid]; - - return MAPISTORE_ERROR; -} - - (int) setPropertiesWithFMID: (uint64_t) fmid ofTableType: (uint8_t) tableType inRow: (struct SRow *) aRow diff --git a/OpenChange/MAPIStoreSOGo.m b/OpenChange/MAPIStoreSOGo.m index d7048e3a5..8cd4bb300 100644 --- a/OpenChange/MAPIStoreSOGo.m +++ b/OpenChange/MAPIStoreSOGo.m @@ -234,31 +234,6 @@ sogo_get_path(void *private_data, TALLOC_CTX *mem_ctx, return rc; } -static int -sogo_op_get_fid_by_name(void *private_data, uint64_t parent_fid, const char* foldername, uint64_t *fid) -{ - NSAutoreleasePool *pool; - sogo_context *cContext; - MAPIStoreContext *context; - int rc; - - DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__)); - - pool = [NSAutoreleasePool new]; - - cContext = private_data; - context = cContext->objcContext; - [context setupRequest]; - - rc = [context getFID: fid byName: foldername inParentFID: parent_fid]; - - [context tearDownRequest]; - [pool release]; - - return rc; -} - - /** \details Create a folder in the sogo backend @@ -1098,7 +1073,6 @@ int mapistore_init_backend(void) backend.release_record = sogo_release_record; backend.get_path = sogo_get_path; - backend.op_get_fid_by_name = sogo_op_get_fid_by_name; backend.op_mkdir = sogo_op_mkdir; backend.op_rmdir = sogo_op_rmdir;