propagate from branch 'ca.inverse.sogo.1_3_10' (head 2e5b0e4a79c403ee6edc14f5ee20c4e0decb6219)
to branch 'ca.inverse.sogo' (head 4fa9d5f232411da95f6ddd4d8c85a15ca4aa18d8) Monotone-Parent: 2e5b0e4a79c403ee6edc14f5ee20c4e0decb6219 Monotone-Parent: 4fa9d5f232411da95f6ddd4d8c85a15ca4aa18d8 Monotone-Revision: 010eef1ea5b26dac2a3c224005feae5d974cdef7 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-11-15T11:48:33 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
commit
f5b7591413
|
@ -4,9 +4,7 @@ obj
|
|||
err$
|
||||
build\.log
|
||||
imgs-.*
|
||||
diff
|
||||
.*\.bak$
|
||||
.*\.diff$
|
||||
.*\.d$
|
||||
.*\.log$
|
||||
.*\.ifb$
|
||||
|
|
76
ChangeLog
76
ChangeLog
|
@ -1,19 +1,88 @@
|
|||
2011-11-13 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreContactsMessage.m (-getPrBody:inMemCtx:):
|
||||
same as below.
|
||||
|
||||
* OpenChange/MAPIStoreAppointmentWrapper.m (-getPrBody:inMemCtx:):
|
||||
removed parsing hack since things are now done properly from
|
||||
NGCards.
|
||||
|
||||
* Tests/Unit/TestVersit.m (-test_rendering, -test_parsing):
|
||||
adapted to new NGCards data structure and improved to test further
|
||||
important use cases.
|
||||
|
||||
2011-11-10 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* Tests/Unit/TestVersit.m: new test module for versit parsing and
|
||||
outputting.
|
||||
* Tests/Unit/TestVersit.m: new test module for versit parsing and
|
||||
outputting.
|
||||
|
||||
2011-11-09 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreCalendarMessage.m (-save): set the DESCRIPTION
|
||||
field to the value of PR_BODY_UNICODE or, a textual version of
|
||||
PR_HTML. COMMENT would be nice later.
|
||||
|
||||
* OpenChange/MAPIStoreAppointmentWrapper.m (-getPrBody:inMemCtx:):
|
||||
make use of -[NSString asCardAttributeValues].
|
||||
|
||||
* 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.
|
||||
|
||||
* OpenChange/MAPIStoreVolatileMessage.m (-addProperties:):
|
||||
transfer the content of the "properties" ivar instead of the
|
||||
"newProperties" parameter, so as to benefit from treatment that
|
||||
could have happened in parent classes.
|
||||
|
||||
* OpenChange/MAPIStoreMailVolatileMessage.m
|
||||
(_generateMailDataWithBcc:): don't write the resulting mail body
|
||||
to /tmp/mimegen.eml.
|
||||
|
||||
2011-11-09 Francis Lachapelle <flachapelle@inverse.ca>
|
||||
|
||||
* UI/WebServerResources/SOGoRootPage.js (onLoginClick): don't
|
||||
assume that the checkbox rememberLogin is always part of the template.
|
||||
|
||||
2011-11-08 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreRecurrenceUtils.m
|
||||
(-fillRecurrencePattern:withStartDate:andEndDate:): fixed a crash
|
||||
occurring when no byday mask was specified. We also force a value
|
||||
for the monthday in the case of a yearly event without a proper
|
||||
one.
|
||||
|
||||
2011-11-07 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreFolder.m (-addProperties:): we now override
|
||||
this method instead of -addPropertiesFromRow:. Also, invoking
|
||||
resetCache is no longer required since the "properties" ivar is
|
||||
no longer used in this class.
|
||||
|
||||
* OpenChange/MAPIStoreObject.m (-addPropertiesFromRow:): now
|
||||
invokes [self addProperties:] to modify the "properties" ivar,
|
||||
instead of doing it directly. This enables subclasses to only need
|
||||
overriding -addProperties:.
|
||||
(-resetProperties): removed useless method.
|
||||
|
||||
* OpenChange/MAPIStoreVolatileMessage.m (-addPropertiesFromRow:):
|
||||
removed obsolete overloading of method.
|
||||
|
||||
2011-11-02 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreMessage.m (-setReadFlag:): make overrides
|
||||
optional.
|
||||
|
||||
* OpenChange/MAPIStoreCalendarMessage.m (-save): handle all day
|
||||
events based on the value of PidLidAppointmentSubType.
|
||||
Don't add the timezone component to the vCalendar in that case.
|
||||
Take PidLidAppointmentStateFlags into account before building the
|
||||
list of attendees. Take the organizer passed in the recipients
|
||||
into account when specified.
|
||||
|
||||
2011-11-01 Francis Lachapelle <flachapelle@inverse.ca>
|
||||
|
||||
* UI/WebServerResources/UIxAclEditor.js (addUser): fixed CSS class
|
||||
|
@ -21,6 +90,9 @@
|
|||
|
||||
2011-11-01 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreCalendarMessage.m (-save): added work-around
|
||||
for setting of organizer as an attendee record.
|
||||
|
||||
* OpenChange/MAPIStoreMailMessage.m (-setReadFlag:): implemented
|
||||
basic method, only dealing with actual setting or unsetting of
|
||||
"\Seen".
|
||||
|
|
|
@ -7,6 +7,8 @@ include ../Version
|
|||
|
||||
BACKEND_VERSION = 1.0.0
|
||||
|
||||
UNRTF_VERSION = 0.21.2
|
||||
|
||||
### bootstrap library
|
||||
MAPISTORESOGO = MAPIStoreSOGo
|
||||
LIBRARY_NAME = $(MAPISTORESOGO)
|
||||
|
@ -23,6 +25,12 @@ BUNDLE_NAME = $(SOGOBACKEND)
|
|||
BUNDLE_EXTENSION = .MAPIStore
|
||||
BUNDLE_INSTALL_DIR = $(SOGO_LIBDIR)
|
||||
|
||||
UNRTF_DIR = unrtf-$(UNRTF_VERSION)
|
||||
|
||||
$(SOGOBACKEND)_CPPFLAGS += -I$(UNRTF_DIR)/src
|
||||
|
||||
$(SOGOBACKEND)_SUBPROJECTS = $(UNRTF_DIR)/src
|
||||
|
||||
$(SOGOBACKEND)_PRINCIPAL_CLASS = MAPIApplication
|
||||
|
||||
$(SOGOBACKEND)_OBJC_FILES += \
|
||||
|
@ -120,7 +128,28 @@ $(SOGOBACKEND)_OBJC_FILES += \
|
|||
|
||||
|
||||
$(SOGOBACKEND)_RESOURCE_FILES += \
|
||||
product.plist
|
||||
product.plist \
|
||||
$(UNRTF_DIR)/charmaps/SYMBOL.charmap \
|
||||
$(UNRTF_DIR)/outputs/html.conf
|
||||
|
||||
### unrtf
|
||||
all:: $(UNRTF_DIR)/config.h $(UNRTF_DIR)/src/GNUmakefile
|
||||
|
||||
$(UNRTF_DIR): $(UNRTF_DIR).tar.gz $(UNRTF_DIR).diff
|
||||
@echo " Extracting and patching $(UNRTF_DIR)..."
|
||||
@rm -rf $(UNRTF_DIR)
|
||||
@$(TAR) -xvzf $< > /dev/null
|
||||
@(cd $(UNRTF_DIR) && patch -p1 < ../$(UNRTF_DIR).diff) > /dev/null
|
||||
@touch $(UNRTF_DIR)
|
||||
|
||||
$(UNRTF_DIR)-stamp: $(UNRTF_DIR)
|
||||
@touch $@
|
||||
|
||||
$(UNRTF_DIR)/config.h: $(UNRTF_DIR)-stamp unrtf_config_h
|
||||
@cp unrtf_config_h $(UNRTF_DIR)/config.h
|
||||
|
||||
$(UNRTF_DIR)/src/GNUmakefile: $(UNRTF_DIR)-stamp GNUmakefile.unrtf
|
||||
@cp GNUmakefile.unrtf $@
|
||||
|
||||
### pl reader
|
||||
PLREADER_TOOL = plreader
|
||||
|
@ -133,7 +162,7 @@ TEST_TOOL_NAME += $(PLREADER_TOOL)
|
|||
LIBMAPI_CFLAGS = $(shell pkg-config libmapi --cflags)
|
||||
LIBMAPISTORE_CFLAGS = $(shell pkg-config libmapistore --cflags) -DSAMBA_PREFIX="\"$(shell pkg-config libmapistore --variable=prefix)\""
|
||||
|
||||
ifeq ($(LIBMAPISTORE_CFLAGS),)
|
||||
ifeq ($(LIBMAPI_CFLAGS),)
|
||||
all install::
|
||||
@echo "Cannot build the OpenChange SOGo backend (empty CFLAGS for libmapistore)"
|
||||
else
|
||||
|
@ -160,6 +189,7 @@ SAMBA_LIB_DIR = $(shell pkg-config libmapistore --variable=libdir)
|
|||
include $(GNUSTEP_MAKEFILES)/bundle.make
|
||||
include $(GNUSTEP_MAKEFILES)/library.make
|
||||
include $(GNUSTEP_MAKEFILES)/test-tool.make
|
||||
include $(GNUSTEP_MAKEFILES)/aggregate.make
|
||||
-include GNUmakefile.postamble
|
||||
|
||||
endif
|
||||
|
|
34
OpenChange/GNUmakefile.unrtf
Normal file
34
OpenChange/GNUmakefile.unrtf
Normal file
|
@ -0,0 +1,34 @@
|
|||
# -*-makefile-*-
|
||||
|
||||
# GNUstep makefile
|
||||
|
||||
include $(GNUSTEP_MAKEFILES)/common.make
|
||||
|
||||
UNRTF = unrtf
|
||||
|
||||
SUBPROJECT_NAME = $(UNRTF)
|
||||
|
||||
$(UNRTF)_C_FILES = \
|
||||
attr.c \
|
||||
convert.c \
|
||||
error.c \
|
||||
hash.c \
|
||||
malloc.c \
|
||||
my_iconv.c \
|
||||
output.c \
|
||||
parse.c \
|
||||
unicode.c \
|
||||
user.c \
|
||||
util.c \
|
||||
word.c
|
||||
|
||||
$(UNRTF)_CFLAGS = -DHAVE_CONFIG_H=1 -I. -I../
|
||||
|
||||
# Option include to set any additional variables
|
||||
-include GNUmakefile.preamble
|
||||
|
||||
# Include in the rules for making libraries
|
||||
include $(GNUSTEP_MAKEFILES)/subproject.make
|
||||
|
||||
# Option include to define any additional rules
|
||||
-include GNUmakefile.postamble
|
|
@ -92,8 +92,6 @@ extern NSTimeZone *utcTZ;
|
|||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPrMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPrBody: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPrStartDate: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidAppointmentStateFlags: (void **) data
|
||||
|
@ -129,6 +127,8 @@ extern NSTimeZone *utcTZ;
|
|||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPrImportance: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPrBody: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidIsRecurring: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidRecurring: (void **) data
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
#include <gen_ndr/exchange.h>
|
||||
#include <gen_ndr/property.h>
|
||||
#include <gen_ndr/ndr_property.h>
|
||||
#include <util/attr.h>
|
||||
#include <libmapi/libmapi.h>
|
||||
#include <mapistore/mapistore.h>
|
||||
#include <mapistore/mapistore_errors.h>
|
||||
|
@ -628,20 +629,6 @@ static NSCharacterSet *hexCharacterSet = nil;
|
|||
return [self getYes: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrBody: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
stringValue = [event comment];
|
||||
if (!stringValue)
|
||||
stringValue = @"";
|
||||
|
||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPrStartDate: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
|
@ -1034,6 +1021,22 @@ static NSCharacterSet *hexCharacterSet = nil;
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPrBody: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
NSString *stringValue;
|
||||
|
||||
/* FIXME: there is a confusion in NGCards around "comment" and "description" */
|
||||
stringValue = [event comment];
|
||||
if ([stringValue length] > 0)
|
||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||
else
|
||||
rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidLidIsRecurring: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
|
@ -1402,7 +1405,8 @@ _fillAppointmentRecurrencePattern (struct AppointmentRecurrencePattern *arp,
|
|||
{
|
||||
startDate = [event startDate];
|
||||
relation = [[trigger relationType] lowercaseString];
|
||||
interval = [[trigger value] durationAsTimeInterval];
|
||||
interval = [[trigger flattenedValuesForKey: @""]
|
||||
durationAsTimeInterval];
|
||||
if ([relation isEqualToString: @"end"])
|
||||
relationDate = [event endDate];
|
||||
else
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
- take the tz definitions from Outlook */
|
||||
|
||||
#include <talloc.h>
|
||||
#include <util/attr.h>
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSCalendarDate.h>
|
||||
|
@ -45,6 +46,7 @@
|
|||
#import <Appointments/SOGoAppointmentFolder.h>
|
||||
#import <Appointments/SOGoAppointmentObject.h>
|
||||
#import <Appointments/iCalEntityObject+SOGo.h>
|
||||
#import <Mailer/NSString+Mail.h>
|
||||
|
||||
#import "MAPIStoreAppointmentWrapper.h"
|
||||
#import "MAPIStoreCalendarAttachment.h"
|
||||
|
@ -240,6 +242,12 @@
|
|||
return [[self appointmentWrapper] getPrImportance: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrBody: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [[self appointmentWrapper] getPrBody: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidIsRecurring: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
|
@ -599,7 +607,9 @@
|
|||
[alarm setAction: @"DISPLAY"];
|
||||
trigger = [iCalTrigger elementWithTag: @"trigger"];
|
||||
[trigger setValueType: @"DURATION"];
|
||||
[trigger setValue: [NSString stringWithFormat: @"-PT%@M", delta]];
|
||||
[trigger
|
||||
setSingleValue: [NSString stringWithFormat: @"-PT%@M", delta]
|
||||
forKey: @""];
|
||||
[alarm setTrigger: trigger];
|
||||
[newEvent addToAlarms: alarm];
|
||||
[alarm release];
|
||||
|
@ -610,6 +620,7 @@
|
|||
- (void) save
|
||||
{
|
||||
iCalCalendar *vCalendar;
|
||||
BOOL isAllDay;
|
||||
iCalDateTime *start, *end;
|
||||
iCalTimeZone *tz;
|
||||
NSCalendarDate *now;
|
||||
|
@ -711,9 +722,16 @@
|
|||
if (value)
|
||||
[newEvent setLocation: value];
|
||||
|
||||
tzName = [[self ownerTimeZone] name];
|
||||
tz = [iCalTimeZone timeZoneForName: tzName];
|
||||
[vCalendar addTimeZone: tz];
|
||||
isAllDay = [[properties
|
||||
objectForKey: MAPIPropertyKey (PidLidAppointmentSubType)]
|
||||
boolValue];
|
||||
|
||||
if (!isAllDay)
|
||||
{
|
||||
tzName = [[self ownerTimeZone] name];
|
||||
tz = [iCalTimeZone timeZoneForName: tzName];
|
||||
[vCalendar addTimeZone: tz];
|
||||
}
|
||||
|
||||
// start
|
||||
value = [properties objectForKey: MAPIPropertyKey (PR_START_DATE)];
|
||||
|
@ -723,8 +741,13 @@
|
|||
if (value)
|
||||
{
|
||||
start = (iCalDateTime *) [newEvent uniqueChildWithTag: @"dtstart"];
|
||||
[start setTimeZone: tz];
|
||||
[start setDateTime: value];
|
||||
if (isAllDay)
|
||||
[start setDate: value];
|
||||
else
|
||||
{
|
||||
[start setTimeZone: tz];
|
||||
[start setDateTime: value];
|
||||
}
|
||||
}
|
||||
|
||||
/* end */
|
||||
|
@ -734,8 +757,13 @@
|
|||
if (value)
|
||||
{
|
||||
end = (iCalDateTime *) [newEvent uniqueChildWithTag: @"dtend"];
|
||||
[end setTimeZone: tz];
|
||||
[end setDateTime: value];
|
||||
if (isAllDay)
|
||||
[end setDate: value];
|
||||
else
|
||||
{
|
||||
[end setTimeZone: tz];
|
||||
[end setDateTime: value];
|
||||
}
|
||||
}
|
||||
|
||||
/* priority */
|
||||
|
@ -778,6 +806,22 @@
|
|||
[newEvent setTransparency: @"OPAQUE"];
|
||||
}
|
||||
}
|
||||
|
||||
/* Comment */
|
||||
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)
|
||||
[newEvent setComment: value];
|
||||
|
||||
/* recurrence */
|
||||
value = [properties
|
||||
|
@ -793,75 +837,101 @@
|
|||
/* alarm */
|
||||
[self _setupAlarmDataInEvent: newEvent];
|
||||
|
||||
// Organizer
|
||||
value = [properties objectForKey: @"recipients"];
|
||||
if (value)
|
||||
if ([[properties objectForKey: MAPIPropertyKey (PidLidAppointmentStateFlags)] intValue]
|
||||
!= 0)
|
||||
{
|
||||
NSArray *recipients;
|
||||
NSDictionary *dict;
|
||||
iCalPerson *person;
|
||||
iCalPersonPartStat newPartStat;
|
||||
NSNumber *flags, *trackStatus;
|
||||
int i;
|
||||
|
||||
/* We must set the organizer preliminarily here because, unlike what
|
||||
the doc states, Outlook does not always pass the real organizer
|
||||
in the recipients list. */
|
||||
dict = [activeUser primaryIdentity];
|
||||
person = [iCalPerson new];
|
||||
[person setCn: [dict objectForKey: @"fullName"]];
|
||||
[person setEmail: [dict objectForKey: @"email"]];
|
||||
[newEvent setOrganizer: person];
|
||||
[person release];
|
||||
|
||||
recipients = [value objectForKey: @"to"];
|
||||
|
||||
for (i = 0; i < [recipients count]; i++)
|
||||
// Organizer
|
||||
value = [properties objectForKey: @"recipients"];
|
||||
if (value)
|
||||
{
|
||||
dict = [recipients objectAtIndex: i];
|
||||
flags = [dict objectForKey: MAPIPropertyKey (PR_RECIPIENT_FLAGS)];
|
||||
if (!flags)
|
||||
{
|
||||
[self logWithFormat: @"no recipient flags specified"];
|
||||
break;
|
||||
}
|
||||
NSArray *recipients;
|
||||
NSDictionary *dict;
|
||||
NSString *orgEmail, *attEmail;
|
||||
iCalPerson *person;
|
||||
iCalPersonPartStat newPartStat;
|
||||
NSNumber *flags, *trackStatus;
|
||||
int i, effective;
|
||||
|
||||
/* We must set the organizer preliminarily here because, unlike what
|
||||
the doc states, Outlook does not always pass the real organizer
|
||||
in the recipients list. */
|
||||
dict = [activeUser primaryIdentity];
|
||||
person = [iCalPerson new];
|
||||
[person setCn: [dict objectForKey: @"fullName"]];
|
||||
[person setEmail: [dict objectForKey: @"email"]];
|
||||
orgEmail = [dict objectForKey: @"email"];
|
||||
[person setEmail: orgEmail];
|
||||
[newEvent setOrganizer: person];
|
||||
[person release];
|
||||
|
||||
if (([flags unsignedIntValue] & 0x0002)) /* recipOrganizer */
|
||||
[newEvent setOrganizer: person];
|
||||
else
|
||||
recipients = [value objectForKey: @"to"];
|
||||
effective = 0;
|
||||
for (i = 0; i < [recipients count]; i++)
|
||||
{
|
||||
trackStatus
|
||||
= [dict
|
||||
objectForKey: MAPIPropertyKey (PR_RECIPIENT_TRACKSTATUS)];
|
||||
dict = [recipients objectAtIndex: i];
|
||||
|
||||
/* FIXME: we should provide a data converter between OL
|
||||
partstats and SOGo */
|
||||
switch ([trackStatus unsignedIntValue])
|
||||
flags = [dict objectForKey: MAPIPropertyKey (PR_RECIPIENT_FLAGS)];
|
||||
if (!flags)
|
||||
{
|
||||
case 0x02: /* respTentative */
|
||||
newPartStat = iCalPersonPartStatTentative;
|
||||
break;
|
||||
case 0x03: /* respAccepted */
|
||||
newPartStat = iCalPersonPartStatAccepted;
|
||||
break;
|
||||
case 0x04: /* respDeclined */
|
||||
newPartStat = iCalPersonPartStatDeclined;
|
||||
break;
|
||||
default:
|
||||
newPartStat = iCalPersonPartStatNeedsAction;
|
||||
[self logWithFormat:
|
||||
@"no recipient flags specified: skipping recipient"];
|
||||
continue;
|
||||
}
|
||||
|
||||
[person setParticipationStatus: newPartStat];
|
||||
[person setRsvp: @"TRUE"];
|
||||
[person setRole: @"REQ-PARTICIPANT"];
|
||||
[newEvent addToAttendees: person];
|
||||
person = [iCalPerson new];
|
||||
[person setCn: [dict objectForKey: @"fullName"]];
|
||||
attEmail = [dict objectForKey: @"email"];
|
||||
[person setEmail: attEmail];
|
||||
|
||||
if (([flags unsignedIntValue] & 0x0002)) /* recipOrganizer */
|
||||
[newEvent setOrganizer: person];
|
||||
else
|
||||
{
|
||||
/* Work-around: it happens that Outlook still passes the
|
||||
organizer as a recipient, maybe because of a feature
|
||||
documented in a pre-mesozoic PDF still buried in a
|
||||
cavern... In that case we remove it, and we keep the
|
||||
number of effective recipients in "effective". If the
|
||||
total is 0, we remove the "ORGANIZER" too. */
|
||||
if ([attEmail isEqualToString: orgEmail])
|
||||
{
|
||||
[self logWithFormat:
|
||||
@"avoiding setting organizer as recipient"];
|
||||
continue;
|
||||
}
|
||||
|
||||
trackStatus
|
||||
= [dict
|
||||
objectForKey: MAPIPropertyKey (PR_RECIPIENT_TRACKSTATUS)];
|
||||
|
||||
/* FIXME: we should provide a data converter between OL
|
||||
partstats and SOGo */
|
||||
switch ([trackStatus unsignedIntValue])
|
||||
{
|
||||
case 0x02: /* respTentative */
|
||||
newPartStat = iCalPersonPartStatTentative;
|
||||
break;
|
||||
case 0x03: /* respAccepted */
|
||||
newPartStat = iCalPersonPartStatAccepted;
|
||||
break;
|
||||
case 0x04: /* respDeclined */
|
||||
newPartStat = iCalPersonPartStatDeclined;
|
||||
break;
|
||||
default:
|
||||
newPartStat = iCalPersonPartStatNeedsAction;
|
||||
}
|
||||
|
||||
[person setParticipationStatus: newPartStat];
|
||||
[person setRsvp: @"TRUE"];
|
||||
[person setRole: @"REQ-PARTICIPANT"];
|
||||
[newEvent addToAttendees: person];
|
||||
effective++;
|
||||
}
|
||||
|
||||
[person release];
|
||||
}
|
||||
|
||||
[person release];
|
||||
if (effective == 0) /* See work-around above */
|
||||
[newEvent setOrganizer: nil];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -142,7 +142,8 @@ extern NSTimeZone *utcTZ;
|
|||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
if (!photoData)
|
||||
ASSIGN (photoData, [[photo value: 0] dataByDecodingBase64]);
|
||||
ASSIGN (photoData,
|
||||
[[photo flattenedValuesForKey: @""] dataByDecodingBase64]);
|
||||
|
||||
*data = [photoData asBinaryInMemCtx: memCtx];
|
||||
|
||||
|
@ -153,7 +154,8 @@ extern NSTimeZone *utcTZ;
|
|||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
if (!photoData)
|
||||
ASSIGN (photoData, [[photo value: 0] dataByDecodingBase64]);
|
||||
ASSIGN (photoData,
|
||||
[[photo flattenedValuesForKey: @""] dataByDecodingBase64]);
|
||||
|
||||
*data = MAPILongValue (memCtx, [photoData length]);
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
@ -147,18 +149,11 @@
|
|||
- (int) getPrCompanyName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSArray *values;
|
||||
NSString *stringValue;
|
||||
CardElement *org;
|
||||
|
||||
values = [[sogoObject vCard] org];
|
||||
stringValue = nil;
|
||||
|
||||
if ([values count] > 0)
|
||||
stringValue = [values objectAtIndex: 0];
|
||||
else
|
||||
stringValue = @"";
|
||||
|
||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||
org = [[sogoObject vCard] org];
|
||||
*data = [[org flattenedValueAtIndex: 0 forKey: @""]
|
||||
asUnicodeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
@ -166,18 +161,11 @@
|
|||
- (int) getPrDepartmentName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSArray *values;
|
||||
NSString *stringValue;
|
||||
CardElement *org;
|
||||
|
||||
values = [[sogoObject vCard] org];
|
||||
stringValue = nil;
|
||||
|
||||
if ([values count] > 1)
|
||||
stringValue = [values objectAtIndex: 1];
|
||||
else
|
||||
stringValue = @"";
|
||||
|
||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||
org = [[sogoObject vCard] org];
|
||||
*data = [[org flattenedValueAtIndex: 1 forKey: @""]
|
||||
asUnicodeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
@ -312,7 +300,7 @@
|
|||
max = [emails count];
|
||||
for (count = 0; !stringValue && count < max; count++)
|
||||
{
|
||||
email = [[emails objectAtIndex: count] value: 0];
|
||||
email = [[emails objectAtIndex: count] flattenedValuesForKey: @""];
|
||||
|
||||
if ([email caseInsensitiveCompare: [card preferredEMail]] != NSOrderedSame)
|
||||
stringValue = email;
|
||||
|
@ -372,7 +360,7 @@
|
|||
ce = [elements objectAtIndex: count];
|
||||
if (!aTypeToExclude
|
||||
|| ![ce hasAttribute: @"type" havingValue: aTypeToExclude])
|
||||
stringValue = [ce value: pos];
|
||||
stringValue = [ce flattenedValueAtIndex: pos forKey: @""];
|
||||
}
|
||||
|
||||
if (!stringValue)
|
||||
|
@ -463,7 +451,7 @@
|
|||
NSString *stringValue;
|
||||
|
||||
stringValue = [[[sogoObject vCard] uniqueChildWithTag: @"x-aim"]
|
||||
value: 0];
|
||||
flattenedValuesForKey: @""];
|
||||
if (!stringValue)
|
||||
stringValue = @"";
|
||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||
|
@ -697,7 +685,9 @@
|
|||
{
|
||||
NSString *stringValue;
|
||||
|
||||
stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"] value: 0];
|
||||
stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"]
|
||||
flattenedValueAtIndex: 0
|
||||
forKey: @""];
|
||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
|
@ -708,7 +698,9 @@
|
|||
{
|
||||
NSString *stringValue;
|
||||
|
||||
stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"] value: 1];
|
||||
stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"]
|
||||
flattenedValueAtIndex: 1
|
||||
forKey: @""];
|
||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
|
@ -719,7 +711,9 @@
|
|||
{
|
||||
NSString *stringValue;
|
||||
|
||||
stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"] value: 2];
|
||||
stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"]
|
||||
flattenedValueAtIndex: 2
|
||||
forKey: @""];
|
||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
|
@ -730,7 +724,9 @@
|
|||
{
|
||||
NSString *stringValue;
|
||||
|
||||
stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"] value: 3];
|
||||
stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"]
|
||||
flattenedValueAtIndex: 3
|
||||
forKey: @""];
|
||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
|
@ -741,7 +737,9 @@
|
|||
{
|
||||
NSString *stringValue;
|
||||
|
||||
stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"] value: 4];
|
||||
stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"]
|
||||
flattenedValueAtIndex: 4
|
||||
forKey: @""];
|
||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
|
@ -836,9 +834,9 @@
|
|||
to: photoType];
|
||||
[photo setValue: 0 ofAttribute: @"encoding"
|
||||
to: @"b"];
|
||||
[photo setValue: 0
|
||||
to: [content stringByReplacingString: @"\n"
|
||||
withString: @""]];
|
||||
[photo setSingleValue: [content stringByReplacingString: @"\n"
|
||||
withString: @""]
|
||||
atIndex: 0 forKey: @""];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -885,7 +883,7 @@
|
|||
if (value)
|
||||
{
|
||||
if ([elements count] > 0)
|
||||
[[elements objectAtIndex: 0] setValue: 0 to: value];
|
||||
[[elements objectAtIndex: 0] setSingleValue: value forKey: @""];
|
||||
else
|
||||
[newCard addEmail: value
|
||||
types: [NSArray arrayWithObject: @"pref"]];
|
||||
|
@ -894,7 +892,7 @@
|
|||
if (value)
|
||||
{
|
||||
if ([elements count] > 1)
|
||||
[[elements objectAtIndex: 1] setValue: 0 to: value];
|
||||
[[elements objectAtIndex: 1] setSingleValue: value forKey: @""];
|
||||
else
|
||||
[newCard addEmail: value types: nil];
|
||||
}
|
||||
|
@ -902,7 +900,7 @@
|
|||
if (value)
|
||||
{
|
||||
if ([elements count] > 2)
|
||||
[[elements objectAtIndex: 2] setValue: 0 to: value];
|
||||
[[elements objectAtIndex: 2] setSingleValue: value forKey: @""];
|
||||
else
|
||||
[newCard addEmail: value types: nil];
|
||||
}
|
||||
|
@ -942,7 +940,7 @@
|
|||
[element addAttribute: @"type"
|
||||
value: @"pref"];
|
||||
}
|
||||
[element setValue: 0 to: value];
|
||||
[element setSingleValue: value forKey: @""];
|
||||
}
|
||||
|
||||
elements = [newCard childrenWithTag: @"adr"
|
||||
|
@ -960,22 +958,22 @@
|
|||
[element addAttribute: @"type" value: @"pref"];
|
||||
value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressPostOfficeBox)];
|
||||
if (value)
|
||||
[element setValue: 0 to: value];
|
||||
[element setSingleValue: value atIndex: 0 forKey: @""];
|
||||
value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressStreet)];
|
||||
if (value)
|
||||
[element setValue: 2 to: value];
|
||||
[element setSingleValue: value atIndex: 2 forKey: @""];
|
||||
value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressCity)];
|
||||
if (value)
|
||||
[element setValue: 3 to: value];
|
||||
[element setSingleValue: value atIndex: 3 forKey: @""];
|
||||
value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressState)];
|
||||
if (value)
|
||||
[element setValue: 4 to: value];
|
||||
[element setSingleValue: value atIndex: 4 forKey: @""];
|
||||
value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressPostalCode)];
|
||||
if (value)
|
||||
[element setValue: 5 to: value];
|
||||
[element setSingleValue: value atIndex: 5 forKey: @""];
|
||||
value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressCountry)];
|
||||
if (value)
|
||||
[element setValue: 6 to: value];
|
||||
[element setSingleValue: value atIndex: 6 forKey: @""];
|
||||
|
||||
//
|
||||
// home postal addresses handling
|
||||
|
@ -1001,7 +999,7 @@
|
|||
[element addAttribute: @"type"
|
||||
value: @"pref"];
|
||||
}
|
||||
[element setValue: 0 to: value];
|
||||
[element setSingleValue: value forKey: @""];
|
||||
}
|
||||
|
||||
elements = [newCard childrenWithTag: @"adr"
|
||||
|
@ -1020,22 +1018,22 @@
|
|||
|
||||
value = [properties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_POST_OFFICE_BOX_UNICODE)];
|
||||
if (value)
|
||||
[element setValue: 0 to: value];
|
||||
[element setSingleValue: value atIndex: 0 forKey: @""];
|
||||
value = [properties objectForKey: MAPIPropertyKey( PR_HOME_ADDRESS_STREET_UNICODE)];
|
||||
if (value)
|
||||
[element setValue: 2 to: value];
|
||||
[element setSingleValue: value atIndex: 2 forKey: @""];
|
||||
value = [properties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_CITY_UNICODE)];
|
||||
if (value)
|
||||
[element setValue: 3 to: value];
|
||||
[element setSingleValue: value atIndex: 3 forKey: @""];
|
||||
value = [properties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_STATE_OR_PROVINCE_UNICODE)];
|
||||
if (value)
|
||||
[element setValue: 4 to: value];
|
||||
[element setSingleValue: value atIndex: 4 forKey: @""];
|
||||
value = [properties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_POSTAL_CODE_UNICODE)];
|
||||
if (value)
|
||||
[element setValue: 5 to: value];
|
||||
[element setSingleValue: value atIndex: 5 forKey: @""];
|
||||
value = [properties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_COUNTRY_UNICODE)];
|
||||
if (value)
|
||||
[element setValue: 6 to: value];
|
||||
[element setSingleValue: value atIndex: 6 forKey: @""];
|
||||
|
||||
|
||||
//
|
||||
|
@ -1044,27 +1042,27 @@
|
|||
element = [self _elementWithTag: @"tel" ofType: @"work" forCard: newCard];
|
||||
value = [properties objectForKey: MAPIPropertyKey(PR_OFFICE_TELEPHONE_NUMBER_UNICODE)];
|
||||
if (value)
|
||||
[element setValue: 0 to: value];
|
||||
[element setSingleValue: value forKey: @""];
|
||||
|
||||
element = [self _elementWithTag: @"tel" ofType: @"home" forCard: newCard];
|
||||
value = [properties objectForKey: MAPIPropertyKey(PR_HOME_TELEPHONE_NUMBER_UNICODE)];
|
||||
if (value)
|
||||
[element setValue: 0 to: value];
|
||||
[element setSingleValue: value forKey: @""];
|
||||
|
||||
element = [self _elementWithTag: @"tel" ofType: @"fax" forCard: newCard];
|
||||
value = [properties objectForKey: MAPIPropertyKey(PR_BUSINESS_FAX_NUMBER_UNICODE)];
|
||||
if (value)
|
||||
[element setValue: 0 to: value];
|
||||
[element setSingleValue: value forKey: @""];
|
||||
|
||||
element = [self _elementWithTag: @"tel" ofType: @"pager" forCard: newCard];
|
||||
value = [properties objectForKey: MAPIPropertyKey(PR_PAGER_TELEPHONE_NUMBER_UNICODE)];
|
||||
if (value)
|
||||
[element setValue: 0 to: value];
|
||||
[element setSingleValue: value forKey: @""];
|
||||
|
||||
element = [self _elementWithTag: @"tel" ofType: @"cell" forCard: newCard];
|
||||
value = [properties objectForKey: MAPIPropertyKey(PR_MOBILE_TELEPHONE_NUMBER_UNICODE)];
|
||||
if (value)
|
||||
[element setValue: 0 to: value];
|
||||
[element setSingleValue: value forKey: @""];
|
||||
|
||||
|
||||
//
|
||||
|
@ -1092,15 +1090,14 @@
|
|||
if (value)
|
||||
{
|
||||
[[self _elementWithTag: @"url" ofType: @"work" forCard: newCard]
|
||||
setValue: 0 to: value];
|
||||
setSingleValue: value forKey: @""];
|
||||
}
|
||||
|
||||
value = [properties objectForKey: MAPIPropertyKey(PidLidInstantMessagingAddress)];
|
||||
if (value)
|
||||
{
|
||||
[[newCard uniqueChildWithTag: @"x-aim"]
|
||||
setValue: 0
|
||||
to: value];
|
||||
setSingleValue: value forKey: @""];
|
||||
}
|
||||
|
||||
value = [properties objectForKey: MAPIPropertyKey(PR_BIRTHDAY)];
|
||||
|
@ -1117,6 +1114,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
|
||||
//
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
#undef DEBUG
|
||||
#include <stdbool.h>
|
||||
#include <gen_ndr/exchange.h>
|
||||
#include <util/attr.h>
|
||||
#include <libmapiproxy.h>
|
||||
#include <mapistore/mapistore.h>
|
||||
#include <mapistore/mapistore_errors.h>
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#import "MAPIStoreFAIMessage.h"
|
||||
|
||||
#undef DEBUG
|
||||
#include <talloc.h>
|
||||
#include <util/time.h>
|
||||
#include <mapistore/mapistore.h>
|
||||
|
||||
@implementation MAPIStoreFAIMessage
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
#import "MAPIStoreFAIMessageTable.h"
|
||||
|
||||
#undef DEBUG
|
||||
#include <talloc.h>
|
||||
#include <util/time.h>
|
||||
#include <mapistore/mapistore.h>
|
||||
|
||||
static Class MAPIStoreFAIMessageK = Nil;
|
||||
|
|
|
@ -34,9 +34,6 @@
|
|||
|
||||
#import "MAPIStoreFSBaseContext.h"
|
||||
|
||||
#undef DEBUG
|
||||
#include <mapistore/mapistore.h>
|
||||
|
||||
static Class MAPIStoreFSFolderK;
|
||||
|
||||
@implementation MAPIStoreFSBaseContext
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
|
||||
[sogoObject appendProperties: properties];
|
||||
[sogoObject save];
|
||||
[self resetProperties];
|
||||
[properties removeAllObjects];
|
||||
}
|
||||
|
||||
- (NSDate *) creationTime
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
#include <gen_ndr/exchange.h>
|
||||
|
||||
#undef DEBUG
|
||||
#include <util/attr.h>
|
||||
#include <libmapiproxy.h>
|
||||
#include <mapistore/mapistore.h>
|
||||
#include <mapistore/mapistore_nameid.h>
|
||||
|
@ -898,33 +899,28 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) addPropertiesFromRow: (struct SRow *) aRow
|
||||
- (void) addProperties: (NSDictionary *) newProperties
|
||||
{
|
||||
static enum MAPITAGS bannedProps[] = { PR_MID, PR_FID, PR_PARENT_FID,
|
||||
PR_SOURCE_KEY, PR_PARENT_SOURCE_KEY,
|
||||
PR_CHANGE_KEY, 0x00000000 };
|
||||
enum MAPITAGS *currentProp;
|
||||
int rc;
|
||||
|
||||
rc = [super addPropertiesFromRow: aRow];
|
||||
NSMutableDictionary *propsCopy;
|
||||
|
||||
/* TODO: this should no longer be required once mapistore v2 API is in
|
||||
place, when we can then do this from -dealloc below */
|
||||
if ([properties count] > 0)
|
||||
{
|
||||
currentProp = bannedProps;
|
||||
while (*currentProp)
|
||||
{
|
||||
[properties removeObjectForKey: MAPIPropertyKey (*currentProp)];
|
||||
currentProp++;
|
||||
}
|
||||
|
||||
[propsMessage appendProperties: properties];
|
||||
[propsMessage save];
|
||||
[self resetProperties];
|
||||
propsCopy = [newProperties mutableCopy];
|
||||
currentProp = bannedProps;
|
||||
while (*currentProp)
|
||||
{
|
||||
[propsCopy removeObjectForKey: MAPIPropertyKey (*currentProp)];
|
||||
currentProp++;
|
||||
}
|
||||
|
||||
return rc;
|
||||
[propsMessage appendProperties: propsCopy];
|
||||
[propsMessage save];
|
||||
[propsCopy release];
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
|
|
|
@ -64,6 +64,7 @@
|
|||
static Class SOGoMailFolderK;
|
||||
|
||||
#undef DEBUG
|
||||
#include <util/attr.h>
|
||||
#include <libmapi/libmapi.h>
|
||||
#include <mapistore/mapistore.h>
|
||||
#include <mapistore/mapistore_errors.h>
|
||||
|
|
|
@ -759,7 +759,7 @@ MakeMessageBody (NSDictionary *mailProperties, NSDictionary *attachmentParts,
|
|||
messageData = cleanedMessage;
|
||||
}
|
||||
|
||||
[messageData writeToFile: @"/tmp/mimegen.eml" atomically: NO];
|
||||
// [messageData writeToFile: @"/tmp/mimegen.eml" atomically: NO];
|
||||
|
||||
return messageData;
|
||||
}
|
||||
|
@ -812,7 +812,7 @@ MakeMessageBody (NSDictionary *mailProperties, NSDictionary *attachmentParts,
|
|||
mapping = [[self context] mapping];
|
||||
[mapping unregisterURLWithID: [self objectId]];
|
||||
[self setIsNew: NO];
|
||||
[self resetProperties];
|
||||
[properties removeAllObjects];
|
||||
[[self container] cleanupCaches];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSBundle.h>
|
||||
#import <Foundation/NSData.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSString.h>
|
||||
|
@ -42,6 +43,8 @@
|
|||
|
||||
#import "MAPIStoreMessage.h"
|
||||
|
||||
#include <unrtf.h>
|
||||
|
||||
#undef DEBUG
|
||||
#include <stdbool.h>
|
||||
#include <gen_ndr/exchange.h>
|
||||
|
@ -49,6 +52,8 @@
|
|||
#include <mapistore/mapistore_errors.h>
|
||||
#include <mapistore/mapistore_nameid.h>
|
||||
|
||||
static NSString *resourcesDir = nil;
|
||||
|
||||
NSData *
|
||||
MAPIStoreInternalEntryId (NSString *username)
|
||||
{
|
||||
|
@ -147,6 +152,64 @@ MAPIStoreExternalEntryId (NSString *cn, NSString *email)
|
|||
return entryId;
|
||||
}
|
||||
|
||||
/* rtf conversion via unrtf */
|
||||
static int
|
||||
unrtf_data_output (void *data, const char *str, size_t str_len)
|
||||
{
|
||||
NSMutableData *rtfData = data;
|
||||
|
||||
[rtfData appendBytes: str length: str_len];
|
||||
|
||||
return str_len;
|
||||
}
|
||||
|
||||
static NSData *
|
||||
uncompressRTF (NSData *compressedRTF)
|
||||
{
|
||||
NSData *rtfData = nil;
|
||||
DATA_BLOB *rtf;
|
||||
TALLOC_CTX *mem_ctx;
|
||||
|
||||
mem_ctx = talloc_zero (NULL, TALLOC_CTX);
|
||||
rtf = talloc_zero (mem_ctx, DATA_BLOB);
|
||||
|
||||
if (uncompress_rtf (mem_ctx,
|
||||
(uint8_t *) [compressedRTF bytes], [compressedRTF length],
|
||||
rtf)
|
||||
== MAPI_E_SUCCESS)
|
||||
rtfData = [NSData dataWithBytes: rtf->data length: rtf->length];
|
||||
|
||||
talloc_free (mem_ctx);
|
||||
|
||||
return rtfData;
|
||||
}
|
||||
|
||||
static NSData *
|
||||
rtf2html (NSData *compressedRTF)
|
||||
{
|
||||
NSData *rtf;
|
||||
NSMutableData *html = nil;
|
||||
int rc;
|
||||
struct unRTFOptions unrtfOptions;
|
||||
|
||||
rtf = uncompressRTF (compressedRTF);
|
||||
if (rtf)
|
||||
{
|
||||
html = [NSMutableData data];
|
||||
memset (&unrtfOptions, 0, sizeof (struct unRTFOptions));
|
||||
unrtf_set_output_device (&unrtfOptions, unrtf_data_output, html);
|
||||
unrtfOptions.config_directory = [resourcesDir UTF8String];
|
||||
unrtfOptions.output_format = "html";
|
||||
unrtfOptions.nopict_mode = YES;
|
||||
rc = unrtf_convert_from_string (&unrtfOptions,
|
||||
[rtf bytes], [rtf length]);
|
||||
if (!rc)
|
||||
html = nil;
|
||||
}
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
@interface SOGoObject (MAPIStoreProtocol)
|
||||
|
||||
- (NSString *) davEntityTag;
|
||||
|
@ -156,6 +219,15 @@ MAPIStoreExternalEntryId (NSString *cn, NSString *email)
|
|||
|
||||
@implementation MAPIStoreMessage
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
if (!resourcesDir)
|
||||
{
|
||||
resourcesDir = [[NSBundle bundleForClass: self] resourcePath];
|
||||
[resourcesDir retain];
|
||||
}
|
||||
}
|
||||
|
||||
- (id) init
|
||||
{
|
||||
if ((self = [super init]))
|
||||
|
@ -304,6 +376,38 @@ MAPIStoreExternalEntryId (NSString *cn, NSString *email)
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (void) addProperties: (NSDictionary *) newNewProperties
|
||||
{
|
||||
NSData *htmlData, *rtfData;
|
||||
static NSNumber *htmlKey = nil, *rtfKey = nil;
|
||||
|
||||
[super addProperties: newNewProperties];
|
||||
|
||||
if (!htmlKey)
|
||||
{
|
||||
htmlKey = MAPIPropertyKey (PR_HTML);
|
||||
[htmlKey retain];
|
||||
}
|
||||
|
||||
if (!rtfKey)
|
||||
{
|
||||
rtfKey = MAPIPropertyKey (PR_RTF_COMPRESSED);
|
||||
[rtfKey retain];
|
||||
}
|
||||
|
||||
if (![properties objectForKey: htmlKey])
|
||||
{
|
||||
rtfData = [properties objectForKey: rtfKey];
|
||||
if (rtfData)
|
||||
{
|
||||
htmlData = rtf2html (rtfData);
|
||||
[properties setObject: htmlData forKey: htmlKey];
|
||||
[properties removeObjectForKey: rtfKey];
|
||||
[properties removeObjectForKey: MAPIPropertyKey (PR_RTF_IN_SYNC)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (MAPIStoreAttachment *) createAttachment
|
||||
{
|
||||
MAPIStoreAttachment *newAttachment;
|
||||
|
@ -460,7 +564,7 @@ MAPIStoreExternalEntryId (NSString *cn, NSString *email)
|
|||
[[containerTables objectAtIndex: count]
|
||||
notifyChangesForChild: self];
|
||||
[self setIsNew: NO];
|
||||
[self resetProperties];
|
||||
[properties removeAllObjects];
|
||||
[container cleanupCaches];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
|
@ -744,7 +848,7 @@ MAPIStoreExternalEntryId (NSString *cn, NSString *email)
|
|||
|
||||
- (int) setReadFlag: (uint8_t) flag
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
// [self subclassResponsibility: _cmd];
|
||||
|
||||
return MAPISTORE_ERROR;
|
||||
}
|
||||
|
|
|
@ -86,7 +86,6 @@
|
|||
|
||||
- (void) addProperties: (NSDictionary *) newProperties;
|
||||
- (NSDictionary *) properties;
|
||||
- (void) resetProperties;
|
||||
|
||||
/* ops */
|
||||
- (int) getAvailableProperties: (struct SPropTagArray **) propertiesP
|
||||
|
|
|
@ -235,11 +235,6 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
|||
return properties;
|
||||
}
|
||||
|
||||
- (void) resetProperties
|
||||
{
|
||||
[properties removeAllObjects];
|
||||
}
|
||||
|
||||
- (int) getProperty: (void **) data
|
||||
withTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
|
@ -451,14 +446,18 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
|||
{
|
||||
struct SPropValue *cValue;
|
||||
NSUInteger counter;
|
||||
NSMutableDictionary *newProperties;
|
||||
|
||||
newProperties = [NSMutableDictionary dictionaryWithCapacity: aRow->cValues];
|
||||
for (counter = 0; counter < aRow->cValues; counter++)
|
||||
{
|
||||
cValue = aRow->lpProps + counter;
|
||||
[properties setObject: NSObjectFromSPropValue (cValue)
|
||||
forKey: MAPIPropertyKey (cValue->ulPropTag)];
|
||||
[newProperties setObject: NSObjectFromSPropValue (cValue)
|
||||
forKey: MAPIPropertyKey (cValue->ulPropTag)];
|
||||
}
|
||||
|
||||
[self addProperties: newProperties];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,9 +26,6 @@
|
|||
#import <NGCards/iCalCalendar.h>
|
||||
#import <NGCards/iCalRecurrenceRule.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <gen_ndr/property.h>
|
||||
|
||||
@class NSCalendarDate;
|
||||
@class iCalRepeatableEntityObject;
|
||||
@class iCalRecurrenceRule;
|
||||
|
|
|
@ -32,6 +32,10 @@
|
|||
#import "NSDate+MAPIStore.h"
|
||||
#import "MAPIStoreRecurrenceUtils.h"
|
||||
|
||||
#include <talloc.h>
|
||||
#include <util/time.h>
|
||||
#include <gen_ndr/property.h>
|
||||
|
||||
@implementation iCalCalendar (MAPIStoreRecurrence)
|
||||
|
||||
- (void) setupRecurrenceWithMasterEntity: (iCalRepeatableEntityObject *) entity
|
||||
|
@ -92,7 +96,7 @@
|
|||
[rule setFrequency: iCalRecurrenceFrequenceYearly];
|
||||
[rule setRepeatInterval: rp->Period / 12];
|
||||
month = [NSString stringWithFormat: @"%d", [startDate monthOfYear]];
|
||||
[rule setNamedValue: @"bymonth" to: month];
|
||||
[rule setSingleValue: month forKey: @"bymonth"];
|
||||
}
|
||||
else
|
||||
[self errorWithFormat:
|
||||
|
@ -112,7 +116,7 @@
|
|||
else
|
||||
monthDay = [NSString stringWithFormat: @"%d",
|
||||
rp->PatternTypeSpecific.MonthRecurrencePattern.N];
|
||||
[rule setNamedValue: @"bymonthday" to: monthDay];
|
||||
[rule setSingleValue: monthDay forKey: @"bymonthday"];
|
||||
}
|
||||
else if ((rp->PatternTypeSpecific.MonthRecurrencePattern.WeekRecurrencePattern
|
||||
== 0x3e) /* Nth week day */
|
||||
|
@ -135,8 +139,9 @@
|
|||
else
|
||||
bySetPos = rp->PatternTypeSpecific.MonthRecurrencePattern.N;
|
||||
|
||||
[rule setNamedValue: @"bysetpos"
|
||||
to: [NSString stringWithFormat: @"%d", bySetPos]];
|
||||
[rule
|
||||
setSingleValue: [NSString stringWithFormat: @"%d", bySetPos]
|
||||
forKey: @"bysetpos"];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -163,9 +168,10 @@
|
|||
|| (rp->PatternType & 4) == 4)
|
||||
{
|
||||
/* MonthEnd, HjMonth and HjMonthEnd */
|
||||
[rule setNamedValue: @"bymonthday"
|
||||
to: [NSString stringWithFormat: @"%d",
|
||||
rp->PatternTypeSpecific.Day]];
|
||||
[rule
|
||||
setSingleValue: [NSString stringWithFormat: @"%d",
|
||||
rp->PatternTypeSpecific.Day]
|
||||
forKey: @"bymonthday"];
|
||||
}
|
||||
else
|
||||
[self errorWithFormat: @"invalid value for PatternType: %.4x",
|
||||
|
@ -305,6 +311,14 @@
|
|||
rp->FirstDateTime = [moduloDate asMinutesSince1601];
|
||||
|
||||
byMonthDay = [[self byMonthDay] objectAtIndex: 0];
|
||||
if (!byMonthDay && (freq == iCalRecurrenceFrequenceYearly))
|
||||
{
|
||||
byMonthDay = [NSString stringWithFormat: @"%d", [startDate dayOfMonth]];
|
||||
[self warnWithFormat: @"no month day specified in yearly"
|
||||
@" recurrence: we deduce it from the start date: %@",
|
||||
byMonthDay];
|
||||
}
|
||||
|
||||
if (byMonthDay)
|
||||
{
|
||||
if ([byMonthDay intValue] < 0)
|
||||
|
@ -325,15 +339,18 @@
|
|||
{
|
||||
rp->PatternType = PatternType_MonthNth;
|
||||
byDayMask = [self byDayMask];
|
||||
days = [byDayMask weekDayOccurrences];
|
||||
mask = 0;
|
||||
for (count = 0; count < 7; count++)
|
||||
if (days[0][count])
|
||||
mask |= 1 << count;
|
||||
days = [byDayMask weekDayOccurrences];
|
||||
if (days)
|
||||
{
|
||||
for (count = 0; count < 7; count++)
|
||||
if (days[0][count])
|
||||
mask |= 1 << count;
|
||||
}
|
||||
if (mask)
|
||||
{
|
||||
rp->PatternTypeSpecific.MonthRecurrencePattern.WeekRecurrencePattern = mask;
|
||||
bySetPos = [self namedValue: @"bysetpos"];
|
||||
bySetPos = [self flattenedValuesForKey: @"bysetpos"];
|
||||
if ([bySetPos length])
|
||||
rp->PatternTypeSpecific.MonthRecurrencePattern.N
|
||||
= ([bySetPos hasPrefix: @"-"]
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#import <Foundation/NSValue.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <talloc.h>
|
||||
#include <util/time.h>
|
||||
#include <gen_ndr/exchange.h>
|
||||
|
||||
@class NSData;
|
||||
|
|
|
@ -20,13 +20,6 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#undef DEBUG
|
||||
#include <talloc.h>
|
||||
#include <mapistore/mapistore.h>
|
||||
#include <mapistore/mapistore_errors.h>
|
||||
#include <libmapi/libmapi.h>
|
||||
#include <libmapiproxy.h>
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSException.h>
|
||||
|
@ -38,6 +31,10 @@
|
|||
|
||||
#import "MAPIStoreTypes.h"
|
||||
|
||||
#undef DEBUG
|
||||
#include <mapistore/mapistore.h>
|
||||
#include <mapistore/mapistore_errors.h>
|
||||
|
||||
uint8_t *
|
||||
MAPIBoolValue (void *memCtx, BOOL value)
|
||||
{
|
||||
|
|
|
@ -80,25 +80,10 @@ Class NSNumberK;
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (int) addPropertiesFromRow: (struct SRow *) aRow
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = [super addPropertiesFromRow: aRow];
|
||||
if (rc == MAPISTORE_SUCCESS)
|
||||
{
|
||||
[sogoObject appendProperties: properties];
|
||||
[properties removeAllObjects];
|
||||
ASSIGN (lastModificationTime, [NSDate date]);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (void) addProperties: (NSDictionary *) newProperties
|
||||
{
|
||||
[super addProperties: newProperties];
|
||||
[sogoObject appendProperties: newProperties];
|
||||
[sogoObject appendProperties: properties];
|
||||
[properties removeAllObjects];
|
||||
ASSIGN (lastModificationTime, [NSDate date]);
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#undef DEBUG
|
||||
#include <talloc.h>
|
||||
#include <util/time.h>
|
||||
#include <mapistore/mapistore.h>
|
||||
|
||||
@implementation NSArray (MAPIStoreFolders)
|
||||
|
|
|
@ -24,8 +24,9 @@
|
|||
|
||||
#undef DEBUG
|
||||
#include <stdbool.h>
|
||||
#include <gen_ndr/exchange.h>
|
||||
#include <talloc.h>
|
||||
#include <util/time.h>
|
||||
#include <gen_ndr/exchange.h>
|
||||
|
||||
@implementation NSData (MAPIStoreDataTypes)
|
||||
|
||||
|
|
|
@ -27,8 +27,9 @@
|
|||
#import "NSDate+MAPIStore.h"
|
||||
|
||||
#undef DEBUG
|
||||
#include <mapistore/mapistore.h>
|
||||
#include <talloc.h>
|
||||
#include <util/time.h>
|
||||
#include <mapistore/mapistore.h>
|
||||
|
||||
static NSCalendarDate *refDate = nil;
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
#import "NSString+MAPIStore.h"
|
||||
|
||||
#undef DEBUG
|
||||
#include <talloc.h>
|
||||
#include <util/time.h>
|
||||
#include <mapistore/mapistore.h>
|
||||
|
||||
@implementation NSString (MAPIStoreDataTypes)
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
#import "SOGoMAPIFSFolder.h"
|
||||
|
||||
#undef DEBUG
|
||||
#include <talloc.h>
|
||||
#include <util/time.h>
|
||||
#include <mapistore/mapistore.h>
|
||||
#include <mapistore/mapistore_errors.h>
|
||||
#include <libmapiproxy.h>
|
||||
|
|
|
@ -81,6 +81,8 @@ h_template = """/* %(filename)s (auto-generated) - this file is part of SOGo
|
|||
#import <Foundation/NSObjCRuntime.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <talloc.h>
|
||||
#include <util/time.h>
|
||||
#include <gen_ndr/exchange.h>
|
||||
|
||||
extern const NSUInteger MAPIStorePropertyGettersCount;
|
||||
|
|
11531
OpenChange/unrtf-0.21.2.diff
Normal file
11531
OpenChange/unrtf-0.21.2.diff
Normal file
File diff suppressed because it is too large
Load diff
BIN
OpenChange/unrtf-0.21.2.tar.gz
Normal file
BIN
OpenChange/unrtf-0.21.2.tar.gz
Normal file
Binary file not shown.
75
OpenChange/unrtf_config_h
Normal file
75
OpenChange/unrtf_config_h
Normal file
|
@ -0,0 +1,75 @@
|
|||
/* config.h. Generated from config.h.in by configure. */
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the <ctype.h> header file. */
|
||||
#define HAVE_CTYPE_H 1
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
|
||||
to 0 otherwise. */
|
||||
#define HAVE_MALLOC 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have the `memset' function. */
|
||||
#define HAVE_MEMSET 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdio.h> header file. */
|
||||
#define HAVE_STDIO_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the `strchr' function. */
|
||||
#define HAVE_STRCHR 1
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the `strstr' function. */
|
||||
#define HAVE_STRSTR 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "unrtf"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "bug-unrtf@gnu.org"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "unrtf"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "unrtf 0.21.2"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "unrtf"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "0.21.2"
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "0.21.2"
|
||||
|
||||
/* Define to rpl_malloc if the replacement function should be used. */
|
||||
/* #undef malloc */
|
Loading…
Reference in a new issue