Monotone-Parent: ead3fff3d76689011b8b8b7eac980671612662e5
Monotone-Revision: 2448001ef69730541ee1c822cf80c131176b1ed0 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-11-09T20:10:31 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
eb3d3daa07
commit
1e9a61705c
|
@ -1,5 +1,9 @@
|
|||
2011-11-09 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreContactsMessage.m (-save): set the NOTE
|
||||
field to the value of PR_BODY_UNICODE or, a textual version of
|
||||
PR_HTML.
|
||||
|
||||
* OpenChange/MAPIStoreMessage.m (-addProperties): intercept
|
||||
PR_RTF_COMPRESSED attributes and convert them automatically to a
|
||||
PR_HTML attribute.
|
||||
|
|
|
@ -27,10 +27,12 @@
|
|||
#import <Foundation/NSString.h>
|
||||
#import <NGExtensions/NGBase64Coding.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
#import <NGCards/NSArray+NGCards.h>
|
||||
#import <NGCards/NGVCard.h>
|
||||
#import <NGCards/NGVCardPhoto.h>
|
||||
#import <NGCards/NSArray+NGCards.h>
|
||||
#import <NGCards/NSString+NGCards.h>
|
||||
#import <Contacts/SOGoContactGCSEntry.h>
|
||||
#import <Mailer/NSString+Mail.h>
|
||||
|
||||
#import "MAPIStoreContactsAttachment.h"
|
||||
#import "MAPIStoreContactsFolder.h"
|
||||
|
@ -337,10 +339,16 @@
|
|||
{
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
NSString *stringValue;
|
||||
NSArray *values;
|
||||
|
||||
stringValue = [[sogoObject vCard] note];
|
||||
if ([stringValue length] > 0)
|
||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||
{
|
||||
/* FIXME: this is a temporary hack: we unescape things although NGVCards
|
||||
should already have done it at this stage... */
|
||||
values = [stringValue asCardAttributeValues];
|
||||
*data = [[values objectAtIndex: 0] asUnicodeInMemCtx: memCtx];
|
||||
}
|
||||
else
|
||||
rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
|
||||
|
@ -1117,6 +1125,22 @@
|
|||
fromProperties: [attachment properties]];
|
||||
}
|
||||
|
||||
/* Note */
|
||||
value = [properties objectForKey: MAPIPropertyKey (PR_BODY_UNICODE)];
|
||||
if (!value)
|
||||
{
|
||||
value = [properties objectForKey: MAPIPropertyKey (PR_HTML)];
|
||||
if (value)
|
||||
{
|
||||
value = [[NSString alloc] initWithData: value
|
||||
encoding: NSUTF8StringEncoding];
|
||||
[value autorelease];
|
||||
value = [value htmlToText];
|
||||
}
|
||||
}
|
||||
if (value)
|
||||
[newCard setNote: value];
|
||||
|
||||
//
|
||||
// we save the new/modified card
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue