mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-23 23:22:45 +00:00
Monotone-Parent: a1865313ff7142cbf139f7645dcbb299dd1acb92
Monotone-Revision: 06779f0bbfe40e7611b69790cf2eff4809382438 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-06-07T00:17:46 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -20,16 +20,49 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSData.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
|
||||
#import "MAPIStorePropertySelectors.h"
|
||||
#import "MAPIStoreTypes.h"
|
||||
#import "NSObject+MAPIStore.h"
|
||||
#import "NSString+MAPIStore.h"
|
||||
#import "SOGoMAPIFSMessage.h"
|
||||
|
||||
#import "MAPIStoreFSMessage.h"
|
||||
|
||||
#undef DEBUG
|
||||
#include <mapistore/mapistore_errors.h>
|
||||
|
||||
@implementation MAPIStoreFSMessage
|
||||
|
||||
+ (int) getAvailableProperties: (struct SPropTagArray **) propertiesP
|
||||
{
|
||||
struct SPropTagArray *properties;
|
||||
NSUInteger count;
|
||||
enum MAPITAGS faiProperties[] = { 0x68350102, 0x683c0102, 0x683e0102,
|
||||
0x683f0102, 0x68410003, 0x68420102,
|
||||
0x68450102, 0x68460003 };
|
||||
|
||||
properties = talloc_zero (NULL, struct SPropTagArray);
|
||||
properties->cValues = MAPIStoreSupportedPropertiesCount + 8;
|
||||
properties->aulPropTag = talloc_array (NULL, enum MAPITAGS,
|
||||
MAPIStoreSupportedPropertiesCount + 8);
|
||||
|
||||
for (count = 0; count < MAPIStoreSupportedPropertiesCount; count++)
|
||||
properties->aulPropTag[count] = MAPIStoreSupportedProperties[count];
|
||||
|
||||
/* FIXME (hack): append a few undocumented properties that can be added to
|
||||
FAI messages */
|
||||
for (count = 0; count < 8; count++)
|
||||
properties->aulPropTag[MAPIStoreSupportedPropertiesCount+count] = faiProperties[count];
|
||||
|
||||
*propertiesP = properties;
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (enum MAPISTATUS) getProperty: (void **) data
|
||||
withTag: (enum MAPITAGS) propTag
|
||||
{
|
||||
@@ -45,10 +78,70 @@
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPrSubject: (void **) data
|
||||
{
|
||||
/* if we get here, it means that the properties file didn't contain a
|
||||
relevant value */
|
||||
return [self getEmptyString: data];
|
||||
}
|
||||
|
||||
- (int) getPrMessageClass: (void **) data
|
||||
{
|
||||
/* if we get here, it means that the properties file didn't contain a
|
||||
relevant value */
|
||||
|
||||
*data = [@"IPM.Note" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getAvailableProperties: (struct SPropTagArray **) propertiesP
|
||||
{
|
||||
NSArray *keys;
|
||||
NSUInteger count, max;
|
||||
struct SPropTagArray *properties;
|
||||
|
||||
keys = [[sogoObject properties] allKeys];
|
||||
max = [keys count];
|
||||
|
||||
properties = talloc_zero (NULL, struct SPropTagArray);
|
||||
properties->cValues = max;
|
||||
properties->aulPropTag = talloc_array (properties, enum MAPITAGS, max);
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
// #if (GS_SIZEOF_LONG == 4)
|
||||
// return [NSNumber numberWithUnsignedLong: propTag];
|
||||
// #elif (GS_SIZEOF_INT == 4)
|
||||
// return [NSNumber numberWithUnsignedInt: propTag];
|
||||
// #else
|
||||
|
||||
#if (GS_SIZEOF_LONG == 4)
|
||||
properties->aulPropTag[count] = [[keys objectAtIndex: count] unsignedLongValue];
|
||||
#elif (GS_SIZEOF_INT == 4)
|
||||
properties->aulPropTag[count] = [[keys objectAtIndex: count] unsignedIntValue];
|
||||
#endif
|
||||
}
|
||||
|
||||
*propertiesP = properties;
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (void) save
|
||||
{
|
||||
[sogoObject appendProperties: newProperties];
|
||||
[sogoObject save];
|
||||
[self resetNewProperties];
|
||||
}
|
||||
|
||||
- (NSDate *) creationTime
|
||||
{
|
||||
return [sogoObject creationTime];
|
||||
}
|
||||
|
||||
- (NSDate *) lastModificationTime
|
||||
{
|
||||
return [sogoObject lastModificationTime];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user