oc: PT_SYSTIME is an absolute timestamp
As the epoch is in UTC timezone, we set this timezone for NSCalendarDate.pull/69/head
parent
87a91fbdf2
commit
d5d97db8e8
|
@ -23,7 +23,6 @@
|
||||||
#import <Foundation/NSArray.h>
|
#import <Foundation/NSArray.h>
|
||||||
#import <Foundation/NSCalendarDate.h>
|
#import <Foundation/NSCalendarDate.h>
|
||||||
#import <Foundation/NSDictionary.h>
|
#import <Foundation/NSDictionary.h>
|
||||||
#import <Foundation/NSTimeZone.h>
|
|
||||||
#import <NGExtensions/NSObject+Logs.h>
|
#import <NGExtensions/NSObject+Logs.h>
|
||||||
#import <SOGo/SOGoObject.h>
|
#import <SOGo/SOGoObject.h>
|
||||||
#import <SOGo/SOGoUser.h>
|
#import <SOGo/SOGoUser.h>
|
||||||
|
@ -245,13 +244,8 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||||
struct SPropValue *cValue;
|
struct SPropValue *cValue;
|
||||||
NSUInteger counter;
|
NSUInteger counter;
|
||||||
NSMutableDictionary *newProperties;
|
NSMutableDictionary *newProperties;
|
||||||
NSTimeZone *tz;
|
|
||||||
NSInteger tzOffset;
|
|
||||||
id value;
|
id value;
|
||||||
|
|
||||||
tz = nil;
|
|
||||||
tzOffset = 0;
|
|
||||||
|
|
||||||
newProperties = [NSMutableDictionary dictionaryWithCapacity: aRow->cValues];
|
newProperties = [NSMutableDictionary dictionaryWithCapacity: aRow->cValues];
|
||||||
for (counter = 0; counter < aRow->cValues; counter++)
|
for (counter = 0; counter < aRow->cValues; counter++)
|
||||||
{
|
{
|
||||||
|
@ -268,16 +262,6 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||||
@"attempting to set string property as PR_STRING8: %.8x",
|
@"attempting to set string property as PR_STRING8: %.8x",
|
||||||
cValue->ulPropTag];
|
cValue->ulPropTag];
|
||||||
break;
|
break;
|
||||||
case PT_SYSTIME:
|
|
||||||
if (!tz)
|
|
||||||
{
|
|
||||||
tz = [[self userContext] timeZone];
|
|
||||||
tzOffset = -[tz secondsFromGMT];
|
|
||||||
}
|
|
||||||
value = [value addYear: 0 month: 0 day: 0
|
|
||||||
hour: 0 minute: 0 second: tzOffset];
|
|
||||||
[value setTimeZone: tz];
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
[newProperties setObject: value
|
[newProperties setObject: value
|
||||||
forKey: MAPIPropertyKey (cValue->ulPropTag)];
|
forKey: MAPIPropertyKey (cValue->ulPropTag)];
|
||||||
|
|
|
@ -119,6 +119,7 @@ NSObjectFromMAPISPropValue (const struct mapi_SPropValue *value)
|
||||||
break;
|
break;
|
||||||
case PT_SYSTIME:
|
case PT_SYSTIME:
|
||||||
result = [NSCalendarDate dateFromFileTime: &(value->value.ft)];
|
result = [NSCalendarDate dateFromFileTime: &(value->value.ft)];
|
||||||
|
[result setTimeZone: utcTZ];
|
||||||
break;
|
break;
|
||||||
case PT_BINARY:
|
case PT_BINARY:
|
||||||
case PT_SVREID:
|
case PT_SVREID:
|
||||||
|
|
Loading…
Reference in New Issue