Monotone-Parent: 37431a093d394dea94622106c07943eca6cb743f
Monotone-Revision: cf0e281b1ddabaa9d9d2254c68173616e13215d0 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-11-26T21:48:52 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
b82eeddedb
commit
3e9a276b15
|
@ -4,6 +4,10 @@
|
||||||
function for returning an NSObject from a property tag and a data
|
function for returning an NSObject from a property tag and a data
|
||||||
pointer.
|
pointer.
|
||||||
|
|
||||||
|
* OpenChange/MAPIStoreContext.m
|
||||||
|
(-setProperty:withFMID:ofTableType:fromFile:): new method
|
||||||
|
implementing the "set_property_from_fd" backend operation.
|
||||||
|
|
||||||
2010-11-24 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2010-11-24 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
* OpenChange/SOGoDraftObject+MAPIStore.m: new category module.
|
* OpenChange/SOGoDraftObject+MAPIStore.m: new category module.
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
#define TBL_COLLAPSED_CATEGORY 0x00000004
|
#define TBL_COLLAPSED_CATEGORY 0x00000004
|
||||||
|
|
||||||
@class NSArray;
|
@class NSArray;
|
||||||
|
@class NSFileHandle;
|
||||||
@class NSMutableDictionary;
|
@class NSMutableDictionary;
|
||||||
@class NSString;
|
@class NSString;
|
||||||
|
|
||||||
|
@ -123,6 +124,10 @@
|
||||||
- (int) setPropertiesWithFMID: (uint64_t) fmid
|
- (int) setPropertiesWithFMID: (uint64_t) fmid
|
||||||
ofTableType: (uint8_t) tableType
|
ofTableType: (uint8_t) tableType
|
||||||
inRow: (struct SRow *) aRow;
|
inRow: (struct SRow *) aRow;
|
||||||
|
- (int) setProperty: (enum MAPITAGS) property
|
||||||
|
withFMID: (uint64_t) fmid
|
||||||
|
ofTableType: (uint8_t) tableType
|
||||||
|
fromFile: (NSFileHandle *) aFile;
|
||||||
- (int) modifyRecipientsWithMID: (uint64_t) mid
|
- (int) modifyRecipientsWithMID: (uint64_t) mid
|
||||||
inRows: (struct ModifyRecipientRow *) rows
|
inRows: (struct ModifyRecipientRow *) rows
|
||||||
withCount: (NSUInteger) max;
|
withCount: (NSUInteger) max;
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Foundation/NSDictionary.h>
|
#import <Foundation/NSDictionary.h>
|
||||||
|
#import <Foundation/NSFileHandle.h>
|
||||||
#import <Foundation/NSNull.h>
|
#import <Foundation/NSNull.h>
|
||||||
#import <Foundation/NSURL.h>
|
#import <Foundation/NSURL.h>
|
||||||
#import <Foundation/NSThread.h>
|
#import <Foundation/NSThread.h>
|
||||||
|
@ -1236,6 +1237,41 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (int) setProperty: (enum MAPITAGS) property
|
||||||
|
withFMID: (uint64_t) fmid
|
||||||
|
ofTableType: (uint8_t) tableType
|
||||||
|
fromFile: (NSFileHandle *) aFile
|
||||||
|
{
|
||||||
|
NSMutableDictionary *message;
|
||||||
|
NSNumber *midNbr;
|
||||||
|
NSData *fileData;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
fileData = [aFile readDataToEndOfFile];
|
||||||
|
switch (tableType)
|
||||||
|
{
|
||||||
|
case MAPISTORE_MESSAGE:
|
||||||
|
midNbr = [NSNumber numberWithUnsignedLongLong: fmid];
|
||||||
|
message = [messages objectForKey: midNbr];
|
||||||
|
if (message)
|
||||||
|
{
|
||||||
|
[message setObject: NSObjectFromStreamData (property, fileData)
|
||||||
|
forKey: MAPIPropertyNumber (property)];
|
||||||
|
rc = MAPISTORE_SUCCESS;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
rc = MAPISTORE_ERR_NOT_FOUND;
|
||||||
|
break;
|
||||||
|
case MAPISTORE_FOLDER:
|
||||||
|
default:
|
||||||
|
[self errorWithFormat: @"%s: value of tableType not handled: %d",
|
||||||
|
__FUNCTION__, tableType];
|
||||||
|
rc = MAPISTORE_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
- (NSDictionary *) _convertRecipientFromRow: (struct RecipientRow *) row
|
- (NSDictionary *) _convertRecipientFromRow: (struct RecipientRow *) row
|
||||||
{
|
{
|
||||||
NSMutableDictionary *recipient;
|
NSMutableDictionary *recipient;
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
/* OpenChange SOGo storage backend */
|
/* OpenChange SOGo storage backend */
|
||||||
|
|
||||||
#import <Foundation/NSAutoreleasePool.h>
|
#import <Foundation/NSAutoreleasePool.h>
|
||||||
|
#import <Foundation/NSFileHandle.h>
|
||||||
#import <Foundation/NSUserDefaults.h>
|
#import <Foundation/NSUserDefaults.h>
|
||||||
|
|
||||||
#import <NGObjWeb/SoProductRegistry.h>
|
#import <NGObjWeb/SoProductRegistry.h>
|
||||||
|
@ -588,6 +589,36 @@ static int sogo_op_setprops(void *private_data,
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int sogo_op_set_property_from_fd(void *private_data,
|
||||||
|
uint64_t fmid, uint8_t type,
|
||||||
|
uint32_t property, int fd)
|
||||||
|
{
|
||||||
|
NSAutoreleasePool *pool;
|
||||||
|
sogo_context *cContext;
|
||||||
|
MAPIStoreContext *context;
|
||||||
|
NSFileHandle *fileHandle;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__));
|
||||||
|
|
||||||
|
pool = [NSAutoreleasePool new];
|
||||||
|
|
||||||
|
cContext = private_data;
|
||||||
|
context = cContext->objcContext;
|
||||||
|
[context setupRequest];
|
||||||
|
|
||||||
|
fileHandle = [[NSFileHandle alloc] initWithFileDescriptor: fd
|
||||||
|
closeOnDealloc: NO];
|
||||||
|
rc = [context setProperty: property withFMID: fmid ofTableType: type
|
||||||
|
fromFile: fileHandle];
|
||||||
|
[fileHandle release];
|
||||||
|
|
||||||
|
[context tearDownRequest];
|
||||||
|
[pool release];
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
static int sogo_op_modifyrecipients(void *private_data,
|
static int sogo_op_modifyrecipients(void *private_data,
|
||||||
uint64_t mid,
|
uint64_t mid,
|
||||||
struct ModifyRecipientRow *rows,
|
struct ModifyRecipientRow *rows,
|
||||||
|
@ -710,6 +741,7 @@ int mapistore_init_backend(void)
|
||||||
backend.op_getprops = sogo_op_getprops;
|
backend.op_getprops = sogo_op_getprops;
|
||||||
backend.op_get_fid_by_name = sogo_op_get_fid_by_name;
|
backend.op_get_fid_by_name = sogo_op_get_fid_by_name;
|
||||||
backend.op_setprops = sogo_op_setprops;
|
backend.op_setprops = sogo_op_setprops;
|
||||||
|
backend.op_set_property_from_fd = sogo_op_set_property_from_fd;
|
||||||
backend.op_modifyrecipients = sogo_op_modifyrecipients;
|
backend.op_modifyrecipients = sogo_op_modifyrecipients;
|
||||||
backend.op_deletemessage = sogo_op_deletemessage;
|
backend.op_deletemessage = sogo_op_deletemessage;
|
||||||
backend.op_get_folders_list = sogo_op_get_folders_list;
|
backend.op_get_folders_list = sogo_op_get_folders_list;
|
||||||
|
|
Loading…
Reference in a new issue