propagate from branch 'ca.inverse.sogo.1_3_10' (head 00afe1e795cd37cafff7687d6f1b8502f4f5735e)
to branch 'ca.inverse.sogo' (head dd0644b62704e75dfed8a39a7e286d593f0014e0) Monotone-Parent: 00afe1e795cd37cafff7687d6f1b8502f4f5735e Monotone-Parent: dd0644b62704e75dfed8a39a7e286d593f0014e0 Monotone-Revision: 6927dc6b0ecbc6c5c3061a56fd1e91ef658279ae Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-11-17T19:08:52 Monotone-Branch: ca.inverse.sogomaint-2.0.2
commit
01be7b7d8f
|
@ -4,9 +4,7 @@ obj
|
||||||
err$
|
err$
|
||||||
build\.log
|
build\.log
|
||||||
imgs-.*
|
imgs-.*
|
||||||
diff
|
|
||||||
.*\.bak$
|
.*\.bak$
|
||||||
.*\.diff$
|
|
||||||
.*\.d$
|
.*\.d$
|
||||||
.*\.log$
|
.*\.log$
|
||||||
.*\.ifb$
|
.*\.ifb$
|
||||||
|
|
19
ChangeLog
19
ChangeLog
|
@ -1,3 +1,22 @@
|
||||||
|
2011-11-17 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* OpenChange/MAPIStoreSamDBUtils.m: new module containing helpers
|
||||||
|
pertaining to the SamDB.
|
||||||
|
(MAPIStoreSamDBUserAttribute): new function that returns the value
|
||||||
|
of a specified key from a user record matching one simple criteria.
|
||||||
|
(MAPIStoreInternalEntrydId, MAPIStoreExternalEntryId): moved
|
||||||
|
functions from MAPIStoreMessage.m.
|
||||||
|
|
||||||
|
* OpenChange/MAPIStoreMessage.m (MAPIStoreInternalEntryId): now
|
||||||
|
takes a ldb_context * parameter pointing to the samdb, which
|
||||||
|
enables us: 1) to return the real legacyExchangeDN 2) to make use
|
||||||
|
of sAMAccountName as search parameter for the username.
|
||||||
|
|
||||||
|
2011-11-16 Ludovic Marcotte <lmarcotte@inverse.ca>
|
||||||
|
|
||||||
|
* SoObjects/SOGo/SOGoSieveManager.m (-updateFiltersForLogin:...)
|
||||||
|
We now handle connection exceptions to avoid crashing sogod.
|
||||||
|
|
||||||
2011-11-13 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2011-11-13 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
* OpenChange/MAPIStoreContactsMessage.m (-getPrBody:inMemCtx:):
|
* OpenChange/MAPIStoreContactsMessage.m (-getPrBody:inMemCtx:):
|
||||||
|
|
|
@ -7,6 +7,8 @@ include ../Version
|
||||||
|
|
||||||
BACKEND_VERSION = 1.0.0
|
BACKEND_VERSION = 1.0.0
|
||||||
|
|
||||||
|
UNRTF_VERSION = 0.21.2
|
||||||
|
|
||||||
### bootstrap library
|
### bootstrap library
|
||||||
MAPISTORESOGO = MAPIStoreSOGo
|
MAPISTORESOGO = MAPIStoreSOGo
|
||||||
LIBRARY_NAME = $(MAPISTORESOGO)
|
LIBRARY_NAME = $(MAPISTORESOGO)
|
||||||
|
@ -23,6 +25,12 @@ BUNDLE_NAME = $(SOGOBACKEND)
|
||||||
BUNDLE_EXTENSION = .MAPIStore
|
BUNDLE_EXTENSION = .MAPIStore
|
||||||
BUNDLE_INSTALL_DIR = $(SOGO_LIBDIR)
|
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)_PRINCIPAL_CLASS = MAPIApplication
|
||||||
|
|
||||||
$(SOGOBACKEND)_OBJC_FILES += \
|
$(SOGOBACKEND)_OBJC_FILES += \
|
||||||
|
@ -120,7 +128,28 @@ $(SOGOBACKEND)_OBJC_FILES += \
|
||||||
|
|
||||||
|
|
||||||
$(SOGOBACKEND)_RESOURCE_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
|
### pl reader
|
||||||
PLREADER_TOOL = plreader
|
PLREADER_TOOL = plreader
|
||||||
|
@ -133,7 +162,7 @@ TEST_TOOL_NAME += $(PLREADER_TOOL)
|
||||||
LIBMAPI_CFLAGS = $(shell pkg-config libmapi --cflags)
|
LIBMAPI_CFLAGS = $(shell pkg-config libmapi --cflags)
|
||||||
LIBMAPISTORE_CFLAGS = $(shell pkg-config libmapistore --cflags) -DSAMBA_PREFIX="\"$(shell pkg-config libmapistore --variable=prefix)\""
|
LIBMAPISTORE_CFLAGS = $(shell pkg-config libmapistore --cflags) -DSAMBA_PREFIX="\"$(shell pkg-config libmapistore --variable=prefix)\""
|
||||||
|
|
||||||
ifeq ($(LIBMAPISTORE_CFLAGS),)
|
ifeq ($(LIBMAPI_CFLAGS),)
|
||||||
all install::
|
all install::
|
||||||
@echo "Cannot build the OpenChange SOGo backend (empty CFLAGS for libmapistore)"
|
@echo "Cannot build the OpenChange SOGo backend (empty CFLAGS for libmapistore)"
|
||||||
else
|
else
|
||||||
|
@ -160,6 +189,7 @@ SAMBA_LIB_DIR = $(shell pkg-config libmapistore --variable=libdir)
|
||||||
include $(GNUSTEP_MAKEFILES)/bundle.make
|
include $(GNUSTEP_MAKEFILES)/bundle.make
|
||||||
include $(GNUSTEP_MAKEFILES)/library.make
|
include $(GNUSTEP_MAKEFILES)/library.make
|
||||||
include $(GNUSTEP_MAKEFILES)/test-tool.make
|
include $(GNUSTEP_MAKEFILES)/test-tool.make
|
||||||
|
include $(GNUSTEP_MAKEFILES)/aggregate.make
|
||||||
-include GNUmakefile.postamble
|
-include GNUmakefile.postamble
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -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
|
|
@ -39,6 +39,7 @@ extern NSTimeZone *utcTZ;
|
||||||
|
|
||||||
@interface MAPIStoreAppointmentWrapper : NSObject
|
@interface MAPIStoreAppointmentWrapper : NSObject
|
||||||
{
|
{
|
||||||
|
struct mapistore_connection_info *connInfo;
|
||||||
iCalCalendar *calendar;
|
iCalCalendar *calendar;
|
||||||
iCalEvent *event;
|
iCalEvent *event;
|
||||||
NSTimeZone *timeZone;
|
NSTimeZone *timeZone;
|
||||||
|
@ -56,11 +57,13 @@ extern NSTimeZone *utcTZ;
|
||||||
+ (id) wrapperWithICalEvent: (iCalEvent *) newEvent
|
+ (id) wrapperWithICalEvent: (iCalEvent *) newEvent
|
||||||
andUser: (SOGoUser *) newUser
|
andUser: (SOGoUser *) newUser
|
||||||
andSenderEmail: (NSString *) newSenderEmail
|
andSenderEmail: (NSString *) newSenderEmail
|
||||||
inTimeZone: (NSTimeZone *) newTimeZone;
|
inTimeZone: (NSTimeZone *) newTimeZone
|
||||||
|
withConnectionInfo: (struct mapistore_connection_info *) newConnInfo;
|
||||||
- (id) initWithICalEvent: (iCalEvent *) newEvent
|
- (id) initWithICalEvent: (iCalEvent *) newEvent
|
||||||
andUser: (SOGoUser *) newUser
|
andUser: (SOGoUser *) newUser
|
||||||
andSenderEmail: (NSString *) newSenderEmail
|
andSenderEmail: (NSString *) newSenderEmail
|
||||||
inTimeZone: (NSTimeZone *) newTimeZone;
|
inTimeZone: (NSTimeZone *) newTimeZone
|
||||||
|
withConnectionInfo: (struct mapistore_connection_info *) newConnInfo;
|
||||||
|
|
||||||
/* getters */
|
/* getters */
|
||||||
- (void) fillMessageData: (struct mapistore_message *) dataPtr
|
- (void) fillMessageData: (struct mapistore_message *) dataPtr
|
||||||
|
@ -92,8 +95,6 @@ extern NSTimeZone *utcTZ;
|
||||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||||
- (int) getPrMessageClass: (void **) data
|
- (int) getPrMessageClass: (void **) data
|
||||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||||
- (int) getPrBody: (void **) data
|
|
||||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
|
||||||
- (int) getPrStartDate: (void **) data
|
- (int) getPrStartDate: (void **) data
|
||||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||||
- (int) getPidLidAppointmentStateFlags: (void **) data
|
- (int) getPidLidAppointmentStateFlags: (void **) data
|
||||||
|
@ -129,6 +130,8 @@ extern NSTimeZone *utcTZ;
|
||||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||||
- (int) getPrImportance: (void **) data
|
- (int) getPrImportance: (void **) data
|
||||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||||
|
- (int) getPrBody: (void **) data
|
||||||
|
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||||
- (int) getPidLidIsRecurring: (void **) data
|
- (int) getPidLidIsRecurring: (void **) data
|
||||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||||
- (int) getPidLidRecurring: (void **) data
|
- (int) getPidLidRecurring: (void **) data
|
||||||
|
|
|
@ -37,8 +37,8 @@
|
||||||
#import <NGCards/NSString+NGCards.h>
|
#import <NGCards/NSString+NGCards.h>
|
||||||
#import <SOGo/SOGoUserManager.h>
|
#import <SOGo/SOGoUserManager.h>
|
||||||
|
|
||||||
#import "MAPIStoreMessage.h"
|
|
||||||
#import "MAPIStoreRecurrenceUtils.h"
|
#import "MAPIStoreRecurrenceUtils.h"
|
||||||
|
#import "MAPIStoreSamDBUtils.h"
|
||||||
#import "MAPIStoreTypes.h"
|
#import "MAPIStoreTypes.h"
|
||||||
#import "NSData+MAPIStore.h"
|
#import "NSData+MAPIStore.h"
|
||||||
#import "NSDate+MAPIStore.h"
|
#import "NSDate+MAPIStore.h"
|
||||||
|
@ -53,6 +53,7 @@
|
||||||
#include <gen_ndr/exchange.h>
|
#include <gen_ndr/exchange.h>
|
||||||
#include <gen_ndr/property.h>
|
#include <gen_ndr/property.h>
|
||||||
#include <gen_ndr/ndr_property.h>
|
#include <gen_ndr/ndr_property.h>
|
||||||
|
#include <util/attr.h>
|
||||||
#include <libmapi/libmapi.h>
|
#include <libmapi/libmapi.h>
|
||||||
#include <mapistore/mapistore.h>
|
#include <mapistore/mapistore.h>
|
||||||
#include <mapistore/mapistore_errors.h>
|
#include <mapistore/mapistore_errors.h>
|
||||||
|
@ -79,13 +80,15 @@ static NSCharacterSet *hexCharacterSet = nil;
|
||||||
andUser: (SOGoUser *) newUser
|
andUser: (SOGoUser *) newUser
|
||||||
andSenderEmail: (NSString *) newSenderEmail
|
andSenderEmail: (NSString *) newSenderEmail
|
||||||
inTimeZone: (NSTimeZone *) newTimeZone
|
inTimeZone: (NSTimeZone *) newTimeZone
|
||||||
|
withConnectionInfo: (struct mapistore_connection_info *) newConnInfo
|
||||||
{
|
{
|
||||||
MAPIStoreAppointmentWrapper *wrapper;
|
MAPIStoreAppointmentWrapper *wrapper;
|
||||||
|
|
||||||
wrapper = [[self alloc] initWithICalEvent: newEvent
|
wrapper = [[self alloc] initWithICalEvent: newEvent
|
||||||
andUser: newUser
|
andUser: newUser
|
||||||
andSenderEmail: newSenderEmail
|
andSenderEmail: newSenderEmail
|
||||||
inTimeZone: newTimeZone];
|
inTimeZone: newTimeZone
|
||||||
|
withConnectionInfo: newConnInfo];
|
||||||
[wrapper autorelease];
|
[wrapper autorelease];
|
||||||
|
|
||||||
return wrapper;
|
return wrapper;
|
||||||
|
@ -95,6 +98,7 @@ static NSCharacterSet *hexCharacterSet = nil;
|
||||||
{
|
{
|
||||||
if ((self = [super init]))
|
if ((self = [super init]))
|
||||||
{
|
{
|
||||||
|
connInfo = NULL;
|
||||||
calendar = nil;
|
calendar = nil;
|
||||||
event = nil;
|
event = nil;
|
||||||
timeZone = nil;
|
timeZone = nil;
|
||||||
|
@ -177,9 +181,11 @@ static NSCharacterSet *hexCharacterSet = nil;
|
||||||
andUser: (SOGoUser *) newUser
|
andUser: (SOGoUser *) newUser
|
||||||
andSenderEmail: (NSString *) newSenderEmail
|
andSenderEmail: (NSString *) newSenderEmail
|
||||||
inTimeZone: (NSTimeZone *) newTimeZone
|
inTimeZone: (NSTimeZone *) newTimeZone
|
||||||
|
withConnectionInfo: (struct mapistore_connection_info *) newConnInfo
|
||||||
{
|
{
|
||||||
if ((self = [self init]))
|
if ((self = [self init]))
|
||||||
{
|
{
|
||||||
|
connInfo = newConnInfo;
|
||||||
ASSIGN (event, newEvent);
|
ASSIGN (event, newEvent);
|
||||||
ASSIGN (calendar, [event parent]);
|
ASSIGN (calendar, [event parent]);
|
||||||
ASSIGN (timeZone, newTimeZone);
|
ASSIGN (timeZone, newTimeZone);
|
||||||
|
@ -255,7 +261,7 @@ static NSCharacterSet *hexCharacterSet = nil;
|
||||||
{
|
{
|
||||||
username = [contactInfos objectForKey: @"c_uid"];
|
username = [contactInfos objectForKey: @"c_uid"];
|
||||||
recipient->username = [username asUnicodeInMemCtx: msgData];
|
recipient->username = [username asUnicodeInMemCtx: msgData];
|
||||||
entryId = MAPIStoreInternalEntryId (username);
|
entryId = MAPIStoreInternalEntryId (connInfo->sam_ctx, username);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -356,7 +362,7 @@ static NSCharacterSet *hexCharacterSet = nil;
|
||||||
{
|
{
|
||||||
username = [contactInfos objectForKey: @"c_uid"];
|
username = [contactInfos objectForKey: @"c_uid"];
|
||||||
recipient->username = [username asUnicodeInMemCtx: msgData];
|
recipient->username = [username asUnicodeInMemCtx: msgData];
|
||||||
entryId = MAPIStoreInternalEntryId (username);
|
entryId = MAPIStoreInternalEntryId (connInfo->sam_ctx, username);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -628,20 +634,6 @@ static NSCharacterSet *hexCharacterSet = nil;
|
||||||
return [self getYes: data inMemCtx: memCtx];
|
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
|
- (int) getPrStartDate: (void **) data
|
||||||
inMemCtx: (TALLOC_CTX *) memCtx
|
inMemCtx: (TALLOC_CTX *) memCtx
|
||||||
{
|
{
|
||||||
|
@ -740,7 +732,7 @@ static NSCharacterSet *hexCharacterSet = nil;
|
||||||
if (contactInfos)
|
if (contactInfos)
|
||||||
{
|
{
|
||||||
username = [contactInfos objectForKey: @"c_uid"];
|
username = [contactInfos objectForKey: @"c_uid"];
|
||||||
entryId = MAPIStoreInternalEntryId (username);
|
entryId = MAPIStoreInternalEntryId (connInfo->sam_ctx, username);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
entryId = MAPIStoreExternalEntryId (cn, email);
|
entryId = MAPIStoreExternalEntryId (cn, email);
|
||||||
|
@ -1034,6 +1026,22 @@ static NSCharacterSet *hexCharacterSet = nil;
|
||||||
return MAPISTORE_SUCCESS;
|
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
|
- (int) getPidLidIsRecurring: (void **) data
|
||||||
inMemCtx: (TALLOC_CTX *) memCtx
|
inMemCtx: (TALLOC_CTX *) memCtx
|
||||||
{
|
{
|
||||||
|
@ -1402,7 +1410,8 @@ _fillAppointmentRecurrencePattern (struct AppointmentRecurrencePattern *arp,
|
||||||
{
|
{
|
||||||
startDate = [event startDate];
|
startDate = [event startDate];
|
||||||
relation = [[trigger relationType] lowercaseString];
|
relation = [[trigger relationType] lowercaseString];
|
||||||
interval = [[trigger value] durationAsTimeInterval];
|
interval = [[trigger flattenedValuesForKey: @""]
|
||||||
|
durationAsTimeInterval];
|
||||||
if ([relation isEqualToString: @"end"])
|
if ([relation isEqualToString: @"end"])
|
||||||
relationDate = [event endDate];
|
relationDate = [event endDate];
|
||||||
else
|
else
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
- take the tz definitions from Outlook */
|
- take the tz definitions from Outlook */
|
||||||
|
|
||||||
#include <talloc.h>
|
#include <talloc.h>
|
||||||
|
#include <util/attr.h>
|
||||||
|
|
||||||
#import <Foundation/NSArray.h>
|
#import <Foundation/NSArray.h>
|
||||||
#import <Foundation/NSCalendarDate.h>
|
#import <Foundation/NSCalendarDate.h>
|
||||||
|
@ -45,6 +46,7 @@
|
||||||
#import <Appointments/SOGoAppointmentFolder.h>
|
#import <Appointments/SOGoAppointmentFolder.h>
|
||||||
#import <Appointments/SOGoAppointmentObject.h>
|
#import <Appointments/SOGoAppointmentObject.h>
|
||||||
#import <Appointments/iCalEntityObject+SOGo.h>
|
#import <Appointments/iCalEntityObject+SOGo.h>
|
||||||
|
#import <Mailer/NSString+Mail.h>
|
||||||
|
|
||||||
#import "MAPIStoreAppointmentWrapper.h"
|
#import "MAPIStoreAppointmentWrapper.h"
|
||||||
#import "MAPIStoreCalendarAttachment.h"
|
#import "MAPIStoreCalendarAttachment.h"
|
||||||
|
@ -102,15 +104,18 @@
|
||||||
- (MAPIStoreAppointmentWrapper *) appointmentWrapper
|
- (MAPIStoreAppointmentWrapper *) appointmentWrapper
|
||||||
{
|
{
|
||||||
iCalEvent *event;
|
iCalEvent *event;
|
||||||
|
MAPIStoreContext *context;
|
||||||
|
|
||||||
if (!appointmentWrapper)
|
if (!appointmentWrapper)
|
||||||
{
|
{
|
||||||
event = [sogoObject component: NO secure: NO];
|
event = [sogoObject component: NO secure: NO];
|
||||||
|
context = [self context];
|
||||||
ASSIGN (appointmentWrapper,
|
ASSIGN (appointmentWrapper,
|
||||||
[MAPIStoreAppointmentWrapper wrapperWithICalEvent: event
|
[MAPIStoreAppointmentWrapper wrapperWithICalEvent: event
|
||||||
andUser: [[self context] activeUser]
|
andUser: [context activeUser]
|
||||||
andSenderEmail: nil
|
andSenderEmail: nil
|
||||||
inTimeZone: [self ownerTimeZone]]);
|
inTimeZone: [self ownerTimeZone]
|
||||||
|
withConnectionInfo: [context connectionInfo]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return appointmentWrapper;
|
return appointmentWrapper;
|
||||||
|
@ -240,6 +245,12 @@
|
||||||
return [[self appointmentWrapper] getPrImportance: data inMemCtx: memCtx];
|
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
|
- (int) getPidLidIsRecurring: (void **) data
|
||||||
inMemCtx: (TALLOC_CTX *) memCtx
|
inMemCtx: (TALLOC_CTX *) memCtx
|
||||||
{
|
{
|
||||||
|
@ -599,7 +610,9 @@
|
||||||
[alarm setAction: @"DISPLAY"];
|
[alarm setAction: @"DISPLAY"];
|
||||||
trigger = [iCalTrigger elementWithTag: @"trigger"];
|
trigger = [iCalTrigger elementWithTag: @"trigger"];
|
||||||
[trigger setValueType: @"DURATION"];
|
[trigger setValueType: @"DURATION"];
|
||||||
[trigger setValue: [NSString stringWithFormat: @"-PT%@M", delta]];
|
[trigger
|
||||||
|
setSingleValue: [NSString stringWithFormat: @"-PT%@M", delta]
|
||||||
|
forKey: @""];
|
||||||
[alarm setTrigger: trigger];
|
[alarm setTrigger: trigger];
|
||||||
[newEvent addToAlarms: alarm];
|
[newEvent addToAlarms: alarm];
|
||||||
[alarm release];
|
[alarm release];
|
||||||
|
@ -610,6 +623,7 @@
|
||||||
- (void) save
|
- (void) save
|
||||||
{
|
{
|
||||||
iCalCalendar *vCalendar;
|
iCalCalendar *vCalendar;
|
||||||
|
BOOL isAllDay;
|
||||||
iCalDateTime *start, *end;
|
iCalDateTime *start, *end;
|
||||||
iCalTimeZone *tz;
|
iCalTimeZone *tz;
|
||||||
NSCalendarDate *now;
|
NSCalendarDate *now;
|
||||||
|
@ -711,9 +725,16 @@
|
||||||
if (value)
|
if (value)
|
||||||
[newEvent setLocation: value];
|
[newEvent setLocation: value];
|
||||||
|
|
||||||
tzName = [[self ownerTimeZone] name];
|
isAllDay = [[properties
|
||||||
tz = [iCalTimeZone timeZoneForName: tzName];
|
objectForKey: MAPIPropertyKey (PidLidAppointmentSubType)]
|
||||||
[vCalendar addTimeZone: tz];
|
boolValue];
|
||||||
|
|
||||||
|
if (!isAllDay)
|
||||||
|
{
|
||||||
|
tzName = [[self ownerTimeZone] name];
|
||||||
|
tz = [iCalTimeZone timeZoneForName: tzName];
|
||||||
|
[vCalendar addTimeZone: tz];
|
||||||
|
}
|
||||||
|
|
||||||
// start
|
// start
|
||||||
value = [properties objectForKey: MAPIPropertyKey (PR_START_DATE)];
|
value = [properties objectForKey: MAPIPropertyKey (PR_START_DATE)];
|
||||||
|
@ -723,8 +744,13 @@
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
start = (iCalDateTime *) [newEvent uniqueChildWithTag: @"dtstart"];
|
start = (iCalDateTime *) [newEvent uniqueChildWithTag: @"dtstart"];
|
||||||
[start setTimeZone: tz];
|
if (isAllDay)
|
||||||
[start setDateTime: value];
|
[start setDate: value];
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[start setTimeZone: tz];
|
||||||
|
[start setDateTime: value];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* end */
|
/* end */
|
||||||
|
@ -734,8 +760,13 @@
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
end = (iCalDateTime *) [newEvent uniqueChildWithTag: @"dtend"];
|
end = (iCalDateTime *) [newEvent uniqueChildWithTag: @"dtend"];
|
||||||
[end setTimeZone: tz];
|
if (isAllDay)
|
||||||
[end setDateTime: value];
|
[end setDate: value];
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[end setTimeZone: tz];
|
||||||
|
[end setDateTime: value];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* priority */
|
/* priority */
|
||||||
|
@ -778,6 +809,22 @@
|
||||||
[newEvent setTransparency: @"OPAQUE"];
|
[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 */
|
/* recurrence */
|
||||||
value = [properties
|
value = [properties
|
||||||
|
@ -793,75 +840,101 @@
|
||||||
/* alarm */
|
/* alarm */
|
||||||
[self _setupAlarmDataInEvent: newEvent];
|
[self _setupAlarmDataInEvent: newEvent];
|
||||||
|
|
||||||
// Organizer
|
if ([[properties objectForKey: MAPIPropertyKey (PidLidAppointmentStateFlags)] intValue]
|
||||||
value = [properties objectForKey: @"recipients"];
|
!= 0)
|
||||||
if (value)
|
|
||||||
{
|
{
|
||||||
NSArray *recipients;
|
// Organizer
|
||||||
NSDictionary *dict;
|
value = [properties objectForKey: @"recipients"];
|
||||||
iCalPerson *person;
|
if (value)
|
||||||
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++)
|
|
||||||
{
|
{
|
||||||
dict = [recipients objectAtIndex: i];
|
NSArray *recipients;
|
||||||
flags = [dict objectForKey: MAPIPropertyKey (PR_RECIPIENT_FLAGS)];
|
NSDictionary *dict;
|
||||||
if (!flags)
|
NSString *orgEmail, *attEmail;
|
||||||
{
|
iCalPerson *person;
|
||||||
[self logWithFormat: @"no recipient flags specified"];
|
iCalPersonPartStat newPartStat;
|
||||||
break;
|
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 = [iCalPerson new];
|
||||||
[person setCn: [dict objectForKey: @"fullName"]];
|
[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 */
|
recipients = [value objectForKey: @"to"];
|
||||||
[newEvent setOrganizer: person];
|
effective = 0;
|
||||||
else
|
for (i = 0; i < [recipients count]; i++)
|
||||||
{
|
{
|
||||||
trackStatus
|
dict = [recipients objectAtIndex: i];
|
||||||
= [dict
|
|
||||||
objectForKey: MAPIPropertyKey (PR_RECIPIENT_TRACKSTATUS)];
|
|
||||||
|
|
||||||
/* FIXME: we should provide a data converter between OL
|
flags = [dict objectForKey: MAPIPropertyKey (PR_RECIPIENT_FLAGS)];
|
||||||
partstats and SOGo */
|
if (!flags)
|
||||||
switch ([trackStatus unsignedIntValue])
|
|
||||||
{
|
{
|
||||||
case 0x02: /* respTentative */
|
[self logWithFormat:
|
||||||
newPartStat = iCalPersonPartStatTentative;
|
@"no recipient flags specified: skipping recipient"];
|
||||||
break;
|
continue;
|
||||||
case 0x03: /* respAccepted */
|
|
||||||
newPartStat = iCalPersonPartStatAccepted;
|
|
||||||
break;
|
|
||||||
case 0x04: /* respDeclined */
|
|
||||||
newPartStat = iCalPersonPartStatDeclined;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
newPartStat = iCalPersonPartStatNeedsAction;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[person setParticipationStatus: newPartStat];
|
person = [iCalPerson new];
|
||||||
[person setRsvp: @"TRUE"];
|
[person setCn: [dict objectForKey: @"fullName"]];
|
||||||
[person setRole: @"REQ-PARTICIPANT"];
|
attEmail = [dict objectForKey: @"email"];
|
||||||
[newEvent addToAttendees: person];
|
[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
|
inMemCtx: (TALLOC_CTX *) memCtx
|
||||||
{
|
{
|
||||||
if (!photoData)
|
if (!photoData)
|
||||||
ASSIGN (photoData, [[photo value: 0] dataByDecodingBase64]);
|
ASSIGN (photoData,
|
||||||
|
[[photo flattenedValuesForKey: @""] dataByDecodingBase64]);
|
||||||
|
|
||||||
*data = [photoData asBinaryInMemCtx: memCtx];
|
*data = [photoData asBinaryInMemCtx: memCtx];
|
||||||
|
|
||||||
|
@ -153,7 +154,8 @@ extern NSTimeZone *utcTZ;
|
||||||
inMemCtx: (TALLOC_CTX *) memCtx
|
inMemCtx: (TALLOC_CTX *) memCtx
|
||||||
{
|
{
|
||||||
if (!photoData)
|
if (!photoData)
|
||||||
ASSIGN (photoData, [[photo value: 0] dataByDecodingBase64]);
|
ASSIGN (photoData,
|
||||||
|
[[photo flattenedValuesForKey: @""] dataByDecodingBase64]);
|
||||||
|
|
||||||
*data = MAPILongValue (memCtx, [photoData length]);
|
*data = MAPILongValue (memCtx, [photoData length]);
|
||||||
|
|
||||||
|
|
|
@ -27,10 +27,12 @@
|
||||||
#import <Foundation/NSString.h>
|
#import <Foundation/NSString.h>
|
||||||
#import <NGExtensions/NGBase64Coding.h>
|
#import <NGExtensions/NGBase64Coding.h>
|
||||||
#import <NGExtensions/NSObject+Logs.h>
|
#import <NGExtensions/NSObject+Logs.h>
|
||||||
#import <NGCards/NSArray+NGCards.h>
|
|
||||||
#import <NGCards/NGVCard.h>
|
#import <NGCards/NGVCard.h>
|
||||||
#import <NGCards/NGVCardPhoto.h>
|
#import <NGCards/NGVCardPhoto.h>
|
||||||
|
#import <NGCards/NSArray+NGCards.h>
|
||||||
|
#import <NGCards/NSString+NGCards.h>
|
||||||
#import <Contacts/SOGoContactGCSEntry.h>
|
#import <Contacts/SOGoContactGCSEntry.h>
|
||||||
|
#import <Mailer/NSString+Mail.h>
|
||||||
|
|
||||||
#import "MAPIStoreContactsAttachment.h"
|
#import "MAPIStoreContactsAttachment.h"
|
||||||
#import "MAPIStoreContactsFolder.h"
|
#import "MAPIStoreContactsFolder.h"
|
||||||
|
@ -147,18 +149,11 @@
|
||||||
- (int) getPrCompanyName: (void **) data
|
- (int) getPrCompanyName: (void **) data
|
||||||
inMemCtx: (TALLOC_CTX *) memCtx
|
inMemCtx: (TALLOC_CTX *) memCtx
|
||||||
{
|
{
|
||||||
NSArray *values;
|
CardElement *org;
|
||||||
NSString *stringValue;
|
|
||||||
|
|
||||||
values = [[sogoObject vCard] org];
|
org = [[sogoObject vCard] org];
|
||||||
stringValue = nil;
|
*data = [[org flattenedValueAtIndex: 0 forKey: @""]
|
||||||
|
asUnicodeInMemCtx: memCtx];
|
||||||
if ([values count] > 0)
|
|
||||||
stringValue = [values objectAtIndex: 0];
|
|
||||||
else
|
|
||||||
stringValue = @"";
|
|
||||||
|
|
||||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
|
||||||
|
|
||||||
return MAPISTORE_SUCCESS;
|
return MAPISTORE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -166,18 +161,11 @@
|
||||||
- (int) getPrDepartmentName: (void **) data
|
- (int) getPrDepartmentName: (void **) data
|
||||||
inMemCtx: (TALLOC_CTX *) memCtx
|
inMemCtx: (TALLOC_CTX *) memCtx
|
||||||
{
|
{
|
||||||
NSArray *values;
|
CardElement *org;
|
||||||
NSString *stringValue;
|
|
||||||
|
|
||||||
values = [[sogoObject vCard] org];
|
org = [[sogoObject vCard] org];
|
||||||
stringValue = nil;
|
*data = [[org flattenedValueAtIndex: 1 forKey: @""]
|
||||||
|
asUnicodeInMemCtx: memCtx];
|
||||||
if ([values count] > 1)
|
|
||||||
stringValue = [values objectAtIndex: 1];
|
|
||||||
else
|
|
||||||
stringValue = @"";
|
|
||||||
|
|
||||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
|
||||||
|
|
||||||
return MAPISTORE_SUCCESS;
|
return MAPISTORE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -312,7 +300,7 @@
|
||||||
max = [emails count];
|
max = [emails count];
|
||||||
for (count = 0; !stringValue && count < max; 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)
|
if ([email caseInsensitiveCompare: [card preferredEMail]] != NSOrderedSame)
|
||||||
stringValue = email;
|
stringValue = email;
|
||||||
|
@ -372,7 +360,7 @@
|
||||||
ce = [elements objectAtIndex: count];
|
ce = [elements objectAtIndex: count];
|
||||||
if (!aTypeToExclude
|
if (!aTypeToExclude
|
||||||
|| ![ce hasAttribute: @"type" havingValue: aTypeToExclude])
|
|| ![ce hasAttribute: @"type" havingValue: aTypeToExclude])
|
||||||
stringValue = [ce value: pos];
|
stringValue = [ce flattenedValueAtIndex: pos forKey: @""];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!stringValue)
|
if (!stringValue)
|
||||||
|
@ -463,7 +451,7 @@
|
||||||
NSString *stringValue;
|
NSString *stringValue;
|
||||||
|
|
||||||
stringValue = [[[sogoObject vCard] uniqueChildWithTag: @"x-aim"]
|
stringValue = [[[sogoObject vCard] uniqueChildWithTag: @"x-aim"]
|
||||||
value: 0];
|
flattenedValuesForKey: @""];
|
||||||
if (!stringValue)
|
if (!stringValue)
|
||||||
stringValue = @"";
|
stringValue = @"";
|
||||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||||
|
@ -697,7 +685,9 @@
|
||||||
{
|
{
|
||||||
NSString *stringValue;
|
NSString *stringValue;
|
||||||
|
|
||||||
stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"] value: 0];
|
stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"]
|
||||||
|
flattenedValueAtIndex: 0
|
||||||
|
forKey: @""];
|
||||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||||
|
|
||||||
return MAPISTORE_SUCCESS;
|
return MAPISTORE_SUCCESS;
|
||||||
|
@ -708,7 +698,9 @@
|
||||||
{
|
{
|
||||||
NSString *stringValue;
|
NSString *stringValue;
|
||||||
|
|
||||||
stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"] value: 1];
|
stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"]
|
||||||
|
flattenedValueAtIndex: 1
|
||||||
|
forKey: @""];
|
||||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||||
|
|
||||||
return MAPISTORE_SUCCESS;
|
return MAPISTORE_SUCCESS;
|
||||||
|
@ -719,7 +711,9 @@
|
||||||
{
|
{
|
||||||
NSString *stringValue;
|
NSString *stringValue;
|
||||||
|
|
||||||
stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"] value: 2];
|
stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"]
|
||||||
|
flattenedValueAtIndex: 2
|
||||||
|
forKey: @""];
|
||||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||||
|
|
||||||
return MAPISTORE_SUCCESS;
|
return MAPISTORE_SUCCESS;
|
||||||
|
@ -730,7 +724,9 @@
|
||||||
{
|
{
|
||||||
NSString *stringValue;
|
NSString *stringValue;
|
||||||
|
|
||||||
stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"] value: 3];
|
stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"]
|
||||||
|
flattenedValueAtIndex: 3
|
||||||
|
forKey: @""];
|
||||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||||
|
|
||||||
return MAPISTORE_SUCCESS;
|
return MAPISTORE_SUCCESS;
|
||||||
|
@ -741,7 +737,9 @@
|
||||||
{
|
{
|
||||||
NSString *stringValue;
|
NSString *stringValue;
|
||||||
|
|
||||||
stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"] value: 4];
|
stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"]
|
||||||
|
flattenedValueAtIndex: 4
|
||||||
|
forKey: @""];
|
||||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||||
|
|
||||||
return MAPISTORE_SUCCESS;
|
return MAPISTORE_SUCCESS;
|
||||||
|
@ -836,9 +834,9 @@
|
||||||
to: photoType];
|
to: photoType];
|
||||||
[photo setValue: 0 ofAttribute: @"encoding"
|
[photo setValue: 0 ofAttribute: @"encoding"
|
||||||
to: @"b"];
|
to: @"b"];
|
||||||
[photo setValue: 0
|
[photo setSingleValue: [content stringByReplacingString: @"\n"
|
||||||
to: [content stringByReplacingString: @"\n"
|
withString: @""]
|
||||||
withString: @""]];
|
atIndex: 0 forKey: @""];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -885,7 +883,7 @@
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
if ([elements count] > 0)
|
if ([elements count] > 0)
|
||||||
[[elements objectAtIndex: 0] setValue: 0 to: value];
|
[[elements objectAtIndex: 0] setSingleValue: value forKey: @""];
|
||||||
else
|
else
|
||||||
[newCard addEmail: value
|
[newCard addEmail: value
|
||||||
types: [NSArray arrayWithObject: @"pref"]];
|
types: [NSArray arrayWithObject: @"pref"]];
|
||||||
|
@ -894,7 +892,7 @@
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
if ([elements count] > 1)
|
if ([elements count] > 1)
|
||||||
[[elements objectAtIndex: 1] setValue: 0 to: value];
|
[[elements objectAtIndex: 1] setSingleValue: value forKey: @""];
|
||||||
else
|
else
|
||||||
[newCard addEmail: value types: nil];
|
[newCard addEmail: value types: nil];
|
||||||
}
|
}
|
||||||
|
@ -902,7 +900,7 @@
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
if ([elements count] > 2)
|
if ([elements count] > 2)
|
||||||
[[elements objectAtIndex: 2] setValue: 0 to: value];
|
[[elements objectAtIndex: 2] setSingleValue: value forKey: @""];
|
||||||
else
|
else
|
||||||
[newCard addEmail: value types: nil];
|
[newCard addEmail: value types: nil];
|
||||||
}
|
}
|
||||||
|
@ -942,7 +940,7 @@
|
||||||
[element addAttribute: @"type"
|
[element addAttribute: @"type"
|
||||||
value: @"pref"];
|
value: @"pref"];
|
||||||
}
|
}
|
||||||
[element setValue: 0 to: value];
|
[element setSingleValue: value forKey: @""];
|
||||||
}
|
}
|
||||||
|
|
||||||
elements = [newCard childrenWithTag: @"adr"
|
elements = [newCard childrenWithTag: @"adr"
|
||||||
|
@ -960,22 +958,22 @@
|
||||||
[element addAttribute: @"type" value: @"pref"];
|
[element addAttribute: @"type" value: @"pref"];
|
||||||
value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressPostOfficeBox)];
|
value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressPostOfficeBox)];
|
||||||
if (value)
|
if (value)
|
||||||
[element setValue: 0 to: value];
|
[element setSingleValue: value atIndex: 0 forKey: @""];
|
||||||
value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressStreet)];
|
value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressStreet)];
|
||||||
if (value)
|
if (value)
|
||||||
[element setValue: 2 to: value];
|
[element setSingleValue: value atIndex: 2 forKey: @""];
|
||||||
value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressCity)];
|
value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressCity)];
|
||||||
if (value)
|
if (value)
|
||||||
[element setValue: 3 to: value];
|
[element setSingleValue: value atIndex: 3 forKey: @""];
|
||||||
value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressState)];
|
value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressState)];
|
||||||
if (value)
|
if (value)
|
||||||
[element setValue: 4 to: value];
|
[element setSingleValue: value atIndex: 4 forKey: @""];
|
||||||
value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressPostalCode)];
|
value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressPostalCode)];
|
||||||
if (value)
|
if (value)
|
||||||
[element setValue: 5 to: value];
|
[element setSingleValue: value atIndex: 5 forKey: @""];
|
||||||
value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressCountry)];
|
value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressCountry)];
|
||||||
if (value)
|
if (value)
|
||||||
[element setValue: 6 to: value];
|
[element setSingleValue: value atIndex: 6 forKey: @""];
|
||||||
|
|
||||||
//
|
//
|
||||||
// home postal addresses handling
|
// home postal addresses handling
|
||||||
|
@ -1001,7 +999,7 @@
|
||||||
[element addAttribute: @"type"
|
[element addAttribute: @"type"
|
||||||
value: @"pref"];
|
value: @"pref"];
|
||||||
}
|
}
|
||||||
[element setValue: 0 to: value];
|
[element setSingleValue: value forKey: @""];
|
||||||
}
|
}
|
||||||
|
|
||||||
elements = [newCard childrenWithTag: @"adr"
|
elements = [newCard childrenWithTag: @"adr"
|
||||||
|
@ -1020,22 +1018,22 @@
|
||||||
|
|
||||||
value = [properties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_POST_OFFICE_BOX_UNICODE)];
|
value = [properties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_POST_OFFICE_BOX_UNICODE)];
|
||||||
if (value)
|
if (value)
|
||||||
[element setValue: 0 to: value];
|
[element setSingleValue: value atIndex: 0 forKey: @""];
|
||||||
value = [properties objectForKey: MAPIPropertyKey( PR_HOME_ADDRESS_STREET_UNICODE)];
|
value = [properties objectForKey: MAPIPropertyKey( PR_HOME_ADDRESS_STREET_UNICODE)];
|
||||||
if (value)
|
if (value)
|
||||||
[element setValue: 2 to: value];
|
[element setSingleValue: value atIndex: 2 forKey: @""];
|
||||||
value = [properties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_CITY_UNICODE)];
|
value = [properties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_CITY_UNICODE)];
|
||||||
if (value)
|
if (value)
|
||||||
[element setValue: 3 to: value];
|
[element setSingleValue: value atIndex: 3 forKey: @""];
|
||||||
value = [properties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_STATE_OR_PROVINCE_UNICODE)];
|
value = [properties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_STATE_OR_PROVINCE_UNICODE)];
|
||||||
if (value)
|
if (value)
|
||||||
[element setValue: 4 to: value];
|
[element setSingleValue: value atIndex: 4 forKey: @""];
|
||||||
value = [properties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_POSTAL_CODE_UNICODE)];
|
value = [properties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_POSTAL_CODE_UNICODE)];
|
||||||
if (value)
|
if (value)
|
||||||
[element setValue: 5 to: value];
|
[element setSingleValue: value atIndex: 5 forKey: @""];
|
||||||
value = [properties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_COUNTRY_UNICODE)];
|
value = [properties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_COUNTRY_UNICODE)];
|
||||||
if (value)
|
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];
|
element = [self _elementWithTag: @"tel" ofType: @"work" forCard: newCard];
|
||||||
value = [properties objectForKey: MAPIPropertyKey(PR_OFFICE_TELEPHONE_NUMBER_UNICODE)];
|
value = [properties objectForKey: MAPIPropertyKey(PR_OFFICE_TELEPHONE_NUMBER_UNICODE)];
|
||||||
if (value)
|
if (value)
|
||||||
[element setValue: 0 to: value];
|
[element setSingleValue: value forKey: @""];
|
||||||
|
|
||||||
element = [self _elementWithTag: @"tel" ofType: @"home" forCard: newCard];
|
element = [self _elementWithTag: @"tel" ofType: @"home" forCard: newCard];
|
||||||
value = [properties objectForKey: MAPIPropertyKey(PR_HOME_TELEPHONE_NUMBER_UNICODE)];
|
value = [properties objectForKey: MAPIPropertyKey(PR_HOME_TELEPHONE_NUMBER_UNICODE)];
|
||||||
if (value)
|
if (value)
|
||||||
[element setValue: 0 to: value];
|
[element setSingleValue: value forKey: @""];
|
||||||
|
|
||||||
element = [self _elementWithTag: @"tel" ofType: @"fax" forCard: newCard];
|
element = [self _elementWithTag: @"tel" ofType: @"fax" forCard: newCard];
|
||||||
value = [properties objectForKey: MAPIPropertyKey(PR_BUSINESS_FAX_NUMBER_UNICODE)];
|
value = [properties objectForKey: MAPIPropertyKey(PR_BUSINESS_FAX_NUMBER_UNICODE)];
|
||||||
if (value)
|
if (value)
|
||||||
[element setValue: 0 to: value];
|
[element setSingleValue: value forKey: @""];
|
||||||
|
|
||||||
element = [self _elementWithTag: @"tel" ofType: @"pager" forCard: newCard];
|
element = [self _elementWithTag: @"tel" ofType: @"pager" forCard: newCard];
|
||||||
value = [properties objectForKey: MAPIPropertyKey(PR_PAGER_TELEPHONE_NUMBER_UNICODE)];
|
value = [properties objectForKey: MAPIPropertyKey(PR_PAGER_TELEPHONE_NUMBER_UNICODE)];
|
||||||
if (value)
|
if (value)
|
||||||
[element setValue: 0 to: value];
|
[element setSingleValue: value forKey: @""];
|
||||||
|
|
||||||
element = [self _elementWithTag: @"tel" ofType: @"cell" forCard: newCard];
|
element = [self _elementWithTag: @"tel" ofType: @"cell" forCard: newCard];
|
||||||
value = [properties objectForKey: MAPIPropertyKey(PR_MOBILE_TELEPHONE_NUMBER_UNICODE)];
|
value = [properties objectForKey: MAPIPropertyKey(PR_MOBILE_TELEPHONE_NUMBER_UNICODE)];
|
||||||
if (value)
|
if (value)
|
||||||
[element setValue: 0 to: value];
|
[element setSingleValue: value forKey: @""];
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1092,15 +1090,14 @@
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
[[self _elementWithTag: @"url" ofType: @"work" forCard: newCard]
|
[[self _elementWithTag: @"url" ofType: @"work" forCard: newCard]
|
||||||
setValue: 0 to: value];
|
setSingleValue: value forKey: @""];
|
||||||
}
|
}
|
||||||
|
|
||||||
value = [properties objectForKey: MAPIPropertyKey(PidLidInstantMessagingAddress)];
|
value = [properties objectForKey: MAPIPropertyKey(PidLidInstantMessagingAddress)];
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
[[newCard uniqueChildWithTag: @"x-aim"]
|
[[newCard uniqueChildWithTag: @"x-aim"]
|
||||||
setValue: 0
|
setSingleValue: value forKey: @""];
|
||||||
to: value];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
value = [properties objectForKey: MAPIPropertyKey(PR_BIRTHDAY)];
|
value = [properties objectForKey: MAPIPropertyKey(PR_BIRTHDAY)];
|
||||||
|
@ -1117,6 +1114,22 @@
|
||||||
fromProperties: [attachment properties]];
|
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
|
// we save the new/modified card
|
||||||
//
|
//
|
||||||
|
|
|
@ -56,6 +56,7 @@
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <gen_ndr/exchange.h>
|
#include <gen_ndr/exchange.h>
|
||||||
|
#include <util/attr.h>
|
||||||
#include <libmapiproxy.h>
|
#include <libmapiproxy.h>
|
||||||
#include <mapistore/mapistore.h>
|
#include <mapistore/mapistore.h>
|
||||||
#include <mapistore/mapistore_errors.h>
|
#include <mapistore/mapistore_errors.h>
|
||||||
|
|
|
@ -26,6 +26,8 @@
|
||||||
#import "MAPIStoreFAIMessage.h"
|
#import "MAPIStoreFAIMessage.h"
|
||||||
|
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
|
#include <talloc.h>
|
||||||
|
#include <util/time.h>
|
||||||
#include <mapistore/mapistore.h>
|
#include <mapistore/mapistore.h>
|
||||||
|
|
||||||
@implementation MAPIStoreFAIMessage
|
@implementation MAPIStoreFAIMessage
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
#import "MAPIStoreFAIMessageTable.h"
|
#import "MAPIStoreFAIMessageTable.h"
|
||||||
|
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
|
#include <talloc.h>
|
||||||
|
#include <util/time.h>
|
||||||
#include <mapistore/mapistore.h>
|
#include <mapistore/mapistore.h>
|
||||||
|
|
||||||
static Class MAPIStoreFAIMessageK = Nil;
|
static Class MAPIStoreFAIMessageK = Nil;
|
||||||
|
|
|
@ -34,9 +34,6 @@
|
||||||
|
|
||||||
#import "MAPIStoreFSBaseContext.h"
|
#import "MAPIStoreFSBaseContext.h"
|
||||||
|
|
||||||
#undef DEBUG
|
|
||||||
#include <mapistore/mapistore.h>
|
|
||||||
|
|
||||||
static Class MAPIStoreFSFolderK;
|
static Class MAPIStoreFSFolderK;
|
||||||
|
|
||||||
@implementation MAPIStoreFSBaseContext
|
@implementation MAPIStoreFSBaseContext
|
||||||
|
|
|
@ -80,7 +80,7 @@
|
||||||
|
|
||||||
[sogoObject appendProperties: properties];
|
[sogoObject appendProperties: properties];
|
||||||
[sogoObject save];
|
[sogoObject save];
|
||||||
[self resetProperties];
|
[properties removeAllObjects];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSDate *) creationTime
|
- (NSDate *) creationTime
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
#include <gen_ndr/exchange.h>
|
#include <gen_ndr/exchange.h>
|
||||||
|
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
|
#include <util/attr.h>
|
||||||
#include <libmapiproxy.h>
|
#include <libmapiproxy.h>
|
||||||
#include <mapistore/mapistore.h>
|
#include <mapistore/mapistore.h>
|
||||||
#include <mapistore/mapistore_nameid.h>
|
#include <mapistore/mapistore_nameid.h>
|
||||||
|
@ -898,33 +899,28 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (int) addPropertiesFromRow: (struct SRow *) aRow
|
- (void) addProperties: (NSDictionary *) newProperties
|
||||||
{
|
{
|
||||||
static enum MAPITAGS bannedProps[] = { PR_MID, PR_FID, PR_PARENT_FID,
|
static enum MAPITAGS bannedProps[] = { PR_MID, PR_FID, PR_PARENT_FID,
|
||||||
PR_SOURCE_KEY, PR_PARENT_SOURCE_KEY,
|
PR_SOURCE_KEY, PR_PARENT_SOURCE_KEY,
|
||||||
PR_CHANGE_KEY, 0x00000000 };
|
PR_CHANGE_KEY, 0x00000000 };
|
||||||
enum MAPITAGS *currentProp;
|
enum MAPITAGS *currentProp;
|
||||||
int rc;
|
NSMutableDictionary *propsCopy;
|
||||||
|
|
||||||
rc = [super addPropertiesFromRow: aRow];
|
|
||||||
|
|
||||||
/* TODO: this should no longer be required once mapistore v2 API is in
|
/* TODO: this should no longer be required once mapistore v2 API is in
|
||||||
place, when we can then do this from -dealloc below */
|
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];
|
propsCopy = [newProperties mutableCopy];
|
||||||
[propsMessage save];
|
currentProp = bannedProps;
|
||||||
[self resetProperties];
|
while (*currentProp)
|
||||||
|
{
|
||||||
|
[propsCopy removeObjectForKey: MAPIPropertyKey (*currentProp)];
|
||||||
|
currentProp++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
[propsMessage appendProperties: propsCopy];
|
||||||
|
[propsMessage save];
|
||||||
|
[propsCopy release];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
|
|
|
@ -64,6 +64,7 @@
|
||||||
static Class SOGoMailFolderK;
|
static Class SOGoMailFolderK;
|
||||||
|
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
|
#include <util/attr.h>
|
||||||
#include <libmapi/libmapi.h>
|
#include <libmapi/libmapi.h>
|
||||||
#include <mapistore/mapistore.h>
|
#include <mapistore/mapistore.h>
|
||||||
#include <mapistore/mapistore_errors.h>
|
#include <mapistore/mapistore_errors.h>
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
#import "MAPIStoreMailAttachment.h"
|
#import "MAPIStoreMailAttachment.h"
|
||||||
#import "MAPIStoreMailFolder.h"
|
#import "MAPIStoreMailFolder.h"
|
||||||
#import "MAPIStoreMapping.h"
|
#import "MAPIStoreMapping.h"
|
||||||
|
#import "MAPIStoreSamDBUtils.h"
|
||||||
#import "MAPIStoreTypes.h"
|
#import "MAPIStoreTypes.h"
|
||||||
|
|
||||||
#import "MAPIStoreMailMessage.h"
|
#import "MAPIStoreMailMessage.h"
|
||||||
|
@ -263,6 +264,7 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data)
|
||||||
iCalCalendar *calendar;
|
iCalCalendar *calendar;
|
||||||
iCalEvent *event;
|
iCalEvent *event;
|
||||||
NSString *stringValue, *senderEmail;
|
NSString *stringValue, *senderEmail;
|
||||||
|
MAPIStoreContext *context;
|
||||||
|
|
||||||
if (!appointmentWrapper)
|
if (!appointmentWrapper)
|
||||||
{
|
{
|
||||||
|
@ -280,11 +282,13 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data)
|
||||||
senderEmail = [[from objectAtIndex: 0] email];
|
senderEmail = [[from objectAtIndex: 0] email];
|
||||||
else
|
else
|
||||||
senderEmail = nil;
|
senderEmail = nil;
|
||||||
|
context = [self context];
|
||||||
appointmentWrapper = [MAPIStoreAppointmentWrapper
|
appointmentWrapper = [MAPIStoreAppointmentWrapper
|
||||||
wrapperWithICalEvent: event
|
wrapperWithICalEvent: event
|
||||||
andUser: [[self context] activeUser]
|
andUser: [context activeUser]
|
||||||
andSenderEmail: senderEmail
|
andSenderEmail: senderEmail
|
||||||
inTimeZone: [self ownerTimeZone]];
|
inTimeZone: [self ownerTimeZone]
|
||||||
|
withConnectionInfo: [context connectionInfo]];
|
||||||
[appointmentWrapper retain];
|
[appointmentWrapper retain];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -721,6 +725,7 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data)
|
||||||
NSDictionary *contactInfos;
|
NSDictionary *contactInfos;
|
||||||
NGMailAddress *ngAddress;
|
NGMailAddress *ngAddress;
|
||||||
NSData *entryId;
|
NSData *entryId;
|
||||||
|
struct ldb_context *samCtx;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (fullMail)
|
if (fullMail)
|
||||||
|
@ -743,7 +748,8 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data)
|
||||||
if (contactInfos)
|
if (contactInfos)
|
||||||
{
|
{
|
||||||
username = [contactInfos objectForKey: @"c_uid"];
|
username = [contactInfos objectForKey: @"c_uid"];
|
||||||
entryId = MAPIStoreInternalEntryId (username);
|
samCtx = [[self context] connectionInfo]->sam_ctx;
|
||||||
|
entryId = MAPIStoreInternalEntryId (samCtx, username);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
entryId = MAPIStoreExternalEntryId (cn, email);
|
entryId = MAPIStoreExternalEntryId (cn, email);
|
||||||
|
@ -1349,9 +1355,11 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data)
|
||||||
NSData *entryId;
|
NSData *entryId;
|
||||||
NSDictionary *contactInfos;
|
NSDictionary *contactInfos;
|
||||||
SOGoUserManager *mgr;
|
SOGoUserManager *mgr;
|
||||||
|
struct ldb_context *samCtx;
|
||||||
struct mapistore_message *msgData;
|
struct mapistore_message *msgData;
|
||||||
struct mapistore_message_recipient *recipient;
|
struct mapistore_message_recipient *recipient;
|
||||||
|
|
||||||
|
samCtx = [[self context] connectionInfo]->sam_ctx;
|
||||||
[super getMessageData: &msgData inMemCtx: memCtx];
|
[super getMessageData: &msgData inMemCtx: memCtx];
|
||||||
|
|
||||||
if (!headerSetup)
|
if (!headerSetup)
|
||||||
|
@ -1397,7 +1405,7 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data)
|
||||||
{
|
{
|
||||||
username = [contactInfos objectForKey: @"c_uid"];
|
username = [contactInfos objectForKey: @"c_uid"];
|
||||||
recipient->username = [username asUnicodeInMemCtx: msgData];
|
recipient->username = [username asUnicodeInMemCtx: msgData];
|
||||||
entryId = MAPIStoreInternalEntryId (username);
|
entryId = MAPIStoreInternalEntryId (samCtx, username);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -54,6 +54,7 @@
|
||||||
#import "MAPIStoreMailFolder.h"
|
#import "MAPIStoreMailFolder.h"
|
||||||
#import "MAPIStoreMIME.h"
|
#import "MAPIStoreMIME.h"
|
||||||
#import "MAPIStoreMapping.h"
|
#import "MAPIStoreMapping.h"
|
||||||
|
#import "MAPIStoreSamDBUtils.h"
|
||||||
#import "MAPIStoreTypes.h"
|
#import "MAPIStoreTypes.h"
|
||||||
#import "NSData+MAPIStore.h"
|
#import "NSData+MAPIStore.h"
|
||||||
#import "NSObject+MAPIStore.h"
|
#import "NSObject+MAPIStore.h"
|
||||||
|
@ -249,10 +250,13 @@ static NSString *recTypes[] = { @"orig", @"to", @"cc", @"bcc" };
|
||||||
NSData *entryId;
|
NSData *entryId;
|
||||||
NSDictionary *allRecipients, *dict, *contactInfos;
|
NSDictionary *allRecipients, *dict, *contactInfos;
|
||||||
SOGoUserManager *mgr;
|
SOGoUserManager *mgr;
|
||||||
|
struct ldb_context *samCtx;
|
||||||
struct mapistore_message *msgData;
|
struct mapistore_message *msgData;
|
||||||
struct mapistore_message_recipient *recipient;
|
struct mapistore_message_recipient *recipient;
|
||||||
enum ulRecipClass type;
|
enum ulRecipClass type;
|
||||||
|
|
||||||
|
samCtx = [[self context] connectionInfo]->sam_ctx;
|
||||||
|
|
||||||
[super getMessageData: &msgData inMemCtx: memCtx];
|
[super getMessageData: &msgData inMemCtx: memCtx];
|
||||||
|
|
||||||
allRecipients = [[sogoObject properties] objectForKey: @"recipients"];
|
allRecipients = [[sogoObject properties] objectForKey: @"recipients"];
|
||||||
|
@ -295,7 +299,7 @@ static NSString *recTypes[] = { @"orig", @"to", @"cc", @"bcc" };
|
||||||
{
|
{
|
||||||
username = [contactInfos objectForKey: @"c_uid"];
|
username = [contactInfos objectForKey: @"c_uid"];
|
||||||
recipient->username = [username asUnicodeInMemCtx: msgData];
|
recipient->username = [username asUnicodeInMemCtx: msgData];
|
||||||
entryId = MAPIStoreInternalEntryId (username);
|
entryId = MAPIStoreInternalEntryId (samCtx, username);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -759,7 +763,7 @@ MakeMessageBody (NSDictionary *mailProperties, NSDictionary *attachmentParts,
|
||||||
messageData = cleanedMessage;
|
messageData = cleanedMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
[messageData writeToFile: @"/tmp/mimegen.eml" atomically: NO];
|
// [messageData writeToFile: @"/tmp/mimegen.eml" atomically: NO];
|
||||||
|
|
||||||
return messageData;
|
return messageData;
|
||||||
}
|
}
|
||||||
|
@ -812,7 +816,7 @@ MakeMessageBody (NSDictionary *mailProperties, NSDictionary *attachmentParts,
|
||||||
mapping = [[self context] mapping];
|
mapping = [[self context] mapping];
|
||||||
[mapping unregisterURLWithID: [self objectId]];
|
[mapping unregisterURLWithID: [self objectId]];
|
||||||
[self setIsNew: NO];
|
[self setIsNew: NO];
|
||||||
[self resetProperties];
|
[properties removeAllObjects];
|
||||||
[[self container] cleanupCaches];
|
[[self container] cleanupCaches];
|
||||||
|
|
||||||
return MAPISTORE_SUCCESS;
|
return MAPISTORE_SUCCESS;
|
||||||
|
|
|
@ -37,9 +37,6 @@
|
||||||
|
|
||||||
#import "MAPIStoreObject.h"
|
#import "MAPIStoreObject.h"
|
||||||
|
|
||||||
extern NSData *MAPIStoreInternalEntryId (NSString *username);
|
|
||||||
extern NSData *MAPIStoreExternalEntryId (NSString *cn, NSString *email);
|
|
||||||
|
|
||||||
@interface MAPIStoreMessage : MAPIStoreObject
|
@interface MAPIStoreMessage : MAPIStoreObject
|
||||||
{
|
{
|
||||||
NSArray *attachmentKeys;
|
NSArray *attachmentKeys;
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Foundation/NSArray.h>
|
#import <Foundation/NSArray.h>
|
||||||
|
#import <Foundation/NSBundle.h>
|
||||||
#import <Foundation/NSData.h>
|
#import <Foundation/NSData.h>
|
||||||
#import <Foundation/NSDictionary.h>
|
#import <Foundation/NSDictionary.h>
|
||||||
#import <Foundation/NSString.h>
|
#import <Foundation/NSString.h>
|
||||||
|
@ -35,6 +36,7 @@
|
||||||
#import "MAPIStoreContext.h"
|
#import "MAPIStoreContext.h"
|
||||||
#import "MAPIStoreFolder.h"
|
#import "MAPIStoreFolder.h"
|
||||||
#import "MAPIStorePropertySelectors.h"
|
#import "MAPIStorePropertySelectors.h"
|
||||||
|
#import "MAPIStoreSamDBUtils.h"
|
||||||
#import "MAPIStoreTypes.h"
|
#import "MAPIStoreTypes.h"
|
||||||
#import "NSData+MAPIStore.h"
|
#import "NSData+MAPIStore.h"
|
||||||
#import "NSObject+MAPIStore.h"
|
#import "NSObject+MAPIStore.h"
|
||||||
|
@ -42,6 +44,8 @@
|
||||||
|
|
||||||
#import "MAPIStoreMessage.h"
|
#import "MAPIStoreMessage.h"
|
||||||
|
|
||||||
|
#include <unrtf.h>
|
||||||
|
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <gen_ndr/exchange.h>
|
#include <gen_ndr/exchange.h>
|
||||||
|
@ -49,102 +53,64 @@
|
||||||
#include <mapistore/mapistore_errors.h>
|
#include <mapistore/mapistore_errors.h>
|
||||||
#include <mapistore/mapistore_nameid.h>
|
#include <mapistore/mapistore_nameid.h>
|
||||||
|
|
||||||
NSData *
|
static NSString *resourcesDir = nil;
|
||||||
MAPIStoreInternalEntryId (NSString *username)
|
|
||||||
|
/* rtf conversion via unrtf */
|
||||||
|
static int
|
||||||
|
unrtf_data_output (void *data, const char *str, size_t str_len)
|
||||||
{
|
{
|
||||||
NSMutableData *entryId;
|
NSMutableData *rtfData = data;
|
||||||
static uint8_t providerUid[] = { 0xdc, 0xa7, 0x40, 0xc8,
|
|
||||||
0xc0, 0x42, 0x10, 0x1a,
|
|
||||||
0xb4, 0xb9, 0x08, 0x00,
|
|
||||||
0x2b, 0x2f, 0xe1, 0x82 };
|
|
||||||
NSString *x500dn;
|
|
||||||
|
|
||||||
/* structure:
|
[rtfData appendBytes: str length: str_len];
|
||||||
flags: 32
|
|
||||||
provideruid: 32 * 4
|
|
||||||
version: 32
|
|
||||||
type: 32
|
|
||||||
X500DN: variable */
|
|
||||||
|
|
||||||
entryId = [NSMutableData dataWithCapacity: 256];
|
return str_len;
|
||||||
[entryId appendUInt32: 0]; // flags
|
|
||||||
[entryId appendBytes: providerUid length: 16]; // provideruid
|
|
||||||
[entryId appendUInt32: 1]; // version
|
|
||||||
[entryId appendUInt32: 0]; // type (local mail user)
|
|
||||||
|
|
||||||
/* X500DN */
|
|
||||||
/* FIXME: the DN will likely work on DEMO installations for now but we
|
|
||||||
really should get the dn prefix from the server */
|
|
||||||
x500dn = [NSString stringWithFormat: @"/O=FIRST ORGANIZATION"
|
|
||||||
@"/OU=FIRST ADMINISTRATIVE GROUP"
|
|
||||||
@"/CN=RECIPIENTS/CN=%@", username];
|
|
||||||
[entryId appendData: [x500dn dataUsingEncoding: NSISOLatin1StringEncoding]];
|
|
||||||
[entryId appendUInt8: 0];
|
|
||||||
|
|
||||||
return entryId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NSData *
|
static NSData *
|
||||||
MAPIStoreExternalEntryId (NSString *cn, NSString *email)
|
uncompressRTF (NSData *compressedRTF)
|
||||||
{
|
{
|
||||||
NSMutableData *entryId;
|
NSData *rtfData = nil;
|
||||||
static uint8_t providerUid[] = { 0x81, 0x2b, 0x1f, 0xa4,
|
DATA_BLOB *rtf;
|
||||||
0xbe, 0xa3, 0x10, 0x19,
|
TALLOC_CTX *mem_ctx;
|
||||||
0x9d, 0x6e, 0x00, 0xdd,
|
|
||||||
0x01, 0x0f, 0x54, 0x02 };
|
|
||||||
uint8_t flags21, flags22;
|
|
||||||
|
|
||||||
/* structure:
|
mem_ctx = talloc_zero (NULL, TALLOC_CTX);
|
||||||
flags: 32
|
rtf = talloc_zero (mem_ctx, DATA_BLOB);
|
||||||
provideruid: 32 * 4
|
|
||||||
version: 16
|
|
||||||
{
|
|
||||||
PaD: 1
|
|
||||||
MAE: 2
|
|
||||||
Format: 4
|
|
||||||
M: 1
|
|
||||||
U: 1
|
|
||||||
R: 2
|
|
||||||
L: 1
|
|
||||||
Pad: 4
|
|
||||||
}
|
|
||||||
DisplayName: variable
|
|
||||||
AddressType: variable
|
|
||||||
EmailAddress: variable */
|
|
||||||
|
|
||||||
entryId = [NSMutableData dataWithCapacity: 256];
|
if (uncompress_rtf (mem_ctx,
|
||||||
[entryId appendUInt32: 0]; // flags
|
(uint8_t *) [compressedRTF bytes], [compressedRTF length],
|
||||||
[entryId appendBytes: providerUid length: 16]; // provideruid
|
rtf)
|
||||||
[entryId appendUInt16: 0]; // version
|
== MAPI_E_SUCCESS)
|
||||||
|
rtfData = [NSData dataWithBytes: rtf->data length: rtf->length];
|
||||||
|
|
||||||
flags21 = 0; /* PaD, MAE, R, Pad = 0 */
|
talloc_free (mem_ctx);
|
||||||
flags21 |= 0x16; /* Format: text and HTML */
|
|
||||||
flags21 |= 0x01; /* M: mime format */
|
|
||||||
|
|
||||||
flags22 = 0x90; /* U: unicode, L: no lookup */
|
return rtfData;
|
||||||
[entryId appendUInt8: flags21];
|
}
|
||||||
[entryId appendUInt8: flags22];
|
|
||||||
|
|
||||||
/* DisplayName */
|
static NSData *
|
||||||
if (!cn)
|
rtf2html (NSData *compressedRTF)
|
||||||
cn = @"";
|
{
|
||||||
[entryId
|
NSData *rtf;
|
||||||
appendData: [cn dataUsingEncoding: NSUTF16LittleEndianStringEncoding]];
|
NSMutableData *html = nil;
|
||||||
[entryId appendUInt16: 0];
|
int rc;
|
||||||
|
struct unRTFOptions unrtfOptions;
|
||||||
|
|
||||||
/* AddressType */
|
rtf = uncompressRTF (compressedRTF);
|
||||||
[entryId
|
if (rtf)
|
||||||
appendData: [@"SMTP" dataUsingEncoding: NSUTF16LittleEndianStringEncoding]];
|
{
|
||||||
[entryId appendUInt16: 0];
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/* EMailAddress */
|
return html;
|
||||||
if (!email)
|
|
||||||
email = @"";
|
|
||||||
[entryId
|
|
||||||
appendData: [email dataUsingEncoding: NSUTF16LittleEndianStringEncoding]];
|
|
||||||
[entryId appendUInt16: 0];
|
|
||||||
|
|
||||||
return entryId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@interface SOGoObject (MAPIStoreProtocol)
|
@interface SOGoObject (MAPIStoreProtocol)
|
||||||
|
@ -156,6 +122,15 @@ MAPIStoreExternalEntryId (NSString *cn, NSString *email)
|
||||||
|
|
||||||
@implementation MAPIStoreMessage
|
@implementation MAPIStoreMessage
|
||||||
|
|
||||||
|
+ (void) initialize
|
||||||
|
{
|
||||||
|
if (!resourcesDir)
|
||||||
|
{
|
||||||
|
resourcesDir = [[NSBundle bundleForClass: self] resourcePath];
|
||||||
|
[resourcesDir retain];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (id) init
|
- (id) init
|
||||||
{
|
{
|
||||||
if ((self = [super init]))
|
if ((self = [super init]))
|
||||||
|
@ -304,6 +279,38 @@ MAPIStoreExternalEntryId (NSString *cn, NSString *email)
|
||||||
return MAPISTORE_SUCCESS;
|
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 *) createAttachment
|
||||||
{
|
{
|
||||||
MAPIStoreAttachment *newAttachment;
|
MAPIStoreAttachment *newAttachment;
|
||||||
|
@ -460,7 +467,7 @@ MAPIStoreExternalEntryId (NSString *cn, NSString *email)
|
||||||
[[containerTables objectAtIndex: count]
|
[[containerTables objectAtIndex: count]
|
||||||
notifyChangesForChild: self];
|
notifyChangesForChild: self];
|
||||||
[self setIsNew: NO];
|
[self setIsNew: NO];
|
||||||
[self resetProperties];
|
[properties removeAllObjects];
|
||||||
[container cleanupCaches];
|
[container cleanupCaches];
|
||||||
|
|
||||||
return MAPISTORE_SUCCESS;
|
return MAPISTORE_SUCCESS;
|
||||||
|
@ -744,7 +751,7 @@ MAPIStoreExternalEntryId (NSString *cn, NSString *email)
|
||||||
|
|
||||||
- (int) setReadFlag: (uint8_t) flag
|
- (int) setReadFlag: (uint8_t) flag
|
||||||
{
|
{
|
||||||
[self subclassResponsibility: _cmd];
|
// [self subclassResponsibility: _cmd];
|
||||||
|
|
||||||
return MAPISTORE_ERROR;
|
return MAPISTORE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,6 @@
|
||||||
|
|
||||||
- (void) addProperties: (NSDictionary *) newProperties;
|
- (void) addProperties: (NSDictionary *) newProperties;
|
||||||
- (NSDictionary *) properties;
|
- (NSDictionary *) properties;
|
||||||
- (void) resetProperties;
|
|
||||||
|
|
||||||
/* ops */
|
/* ops */
|
||||||
- (int) getAvailableProperties: (struct SPropTagArray **) propertiesP
|
- (int) getAvailableProperties: (struct SPropTagArray **) propertiesP
|
||||||
|
|
|
@ -235,11 +235,6 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) resetProperties
|
|
||||||
{
|
|
||||||
[properties removeAllObjects];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (int) getProperty: (void **) data
|
- (int) getProperty: (void **) data
|
||||||
withTag: (enum MAPITAGS) propTag
|
withTag: (enum MAPITAGS) propTag
|
||||||
inMemCtx: (TALLOC_CTX *) memCtx
|
inMemCtx: (TALLOC_CTX *) memCtx
|
||||||
|
@ -451,14 +446,18 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||||
{
|
{
|
||||||
struct SPropValue *cValue;
|
struct SPropValue *cValue;
|
||||||
NSUInteger counter;
|
NSUInteger counter;
|
||||||
|
NSMutableDictionary *newProperties;
|
||||||
|
|
||||||
|
newProperties = [NSMutableDictionary dictionaryWithCapacity: aRow->cValues];
|
||||||
for (counter = 0; counter < aRow->cValues; counter++)
|
for (counter = 0; counter < aRow->cValues; counter++)
|
||||||
{
|
{
|
||||||
cValue = aRow->lpProps + counter;
|
cValue = aRow->lpProps + counter;
|
||||||
[properties setObject: NSObjectFromSPropValue (cValue)
|
[newProperties setObject: NSObjectFromSPropValue (cValue)
|
||||||
forKey: MAPIPropertyKey (cValue->ulPropTag)];
|
forKey: MAPIPropertyKey (cValue->ulPropTag)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[self addProperties: newProperties];
|
||||||
|
|
||||||
return MAPISTORE_SUCCESS;
|
return MAPISTORE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,9 +26,6 @@
|
||||||
#import <NGCards/iCalCalendar.h>
|
#import <NGCards/iCalCalendar.h>
|
||||||
#import <NGCards/iCalRecurrenceRule.h>
|
#import <NGCards/iCalRecurrenceRule.h>
|
||||||
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <gen_ndr/property.h>
|
|
||||||
|
|
||||||
@class NSCalendarDate;
|
@class NSCalendarDate;
|
||||||
@class iCalRepeatableEntityObject;
|
@class iCalRepeatableEntityObject;
|
||||||
@class iCalRecurrenceRule;
|
@class iCalRecurrenceRule;
|
||||||
|
|
|
@ -32,6 +32,10 @@
|
||||||
#import "NSDate+MAPIStore.h"
|
#import "NSDate+MAPIStore.h"
|
||||||
#import "MAPIStoreRecurrenceUtils.h"
|
#import "MAPIStoreRecurrenceUtils.h"
|
||||||
|
|
||||||
|
#include <talloc.h>
|
||||||
|
#include <util/time.h>
|
||||||
|
#include <gen_ndr/property.h>
|
||||||
|
|
||||||
@implementation iCalCalendar (MAPIStoreRecurrence)
|
@implementation iCalCalendar (MAPIStoreRecurrence)
|
||||||
|
|
||||||
- (void) setupRecurrenceWithMasterEntity: (iCalRepeatableEntityObject *) entity
|
- (void) setupRecurrenceWithMasterEntity: (iCalRepeatableEntityObject *) entity
|
||||||
|
@ -92,7 +96,7 @@
|
||||||
[rule setFrequency: iCalRecurrenceFrequenceYearly];
|
[rule setFrequency: iCalRecurrenceFrequenceYearly];
|
||||||
[rule setRepeatInterval: rp->Period / 12];
|
[rule setRepeatInterval: rp->Period / 12];
|
||||||
month = [NSString stringWithFormat: @"%d", [startDate monthOfYear]];
|
month = [NSString stringWithFormat: @"%d", [startDate monthOfYear]];
|
||||||
[rule setNamedValue: @"bymonth" to: month];
|
[rule setSingleValue: month forKey: @"bymonth"];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
[self errorWithFormat:
|
[self errorWithFormat:
|
||||||
|
@ -112,7 +116,7 @@
|
||||||
else
|
else
|
||||||
monthDay = [NSString stringWithFormat: @"%d",
|
monthDay = [NSString stringWithFormat: @"%d",
|
||||||
rp->PatternTypeSpecific.MonthRecurrencePattern.N];
|
rp->PatternTypeSpecific.MonthRecurrencePattern.N];
|
||||||
[rule setNamedValue: @"bymonthday" to: monthDay];
|
[rule setSingleValue: monthDay forKey: @"bymonthday"];
|
||||||
}
|
}
|
||||||
else if ((rp->PatternTypeSpecific.MonthRecurrencePattern.WeekRecurrencePattern
|
else if ((rp->PatternTypeSpecific.MonthRecurrencePattern.WeekRecurrencePattern
|
||||||
== 0x3e) /* Nth week day */
|
== 0x3e) /* Nth week day */
|
||||||
|
@ -135,8 +139,9 @@
|
||||||
else
|
else
|
||||||
bySetPos = rp->PatternTypeSpecific.MonthRecurrencePattern.N;
|
bySetPos = rp->PatternTypeSpecific.MonthRecurrencePattern.N;
|
||||||
|
|
||||||
[rule setNamedValue: @"bysetpos"
|
[rule
|
||||||
to: [NSString stringWithFormat: @"%d", bySetPos]];
|
setSingleValue: [NSString stringWithFormat: @"%d", bySetPos]
|
||||||
|
forKey: @"bysetpos"];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -163,9 +168,10 @@
|
||||||
|| (rp->PatternType & 4) == 4)
|
|| (rp->PatternType & 4) == 4)
|
||||||
{
|
{
|
||||||
/* MonthEnd, HjMonth and HjMonthEnd */
|
/* MonthEnd, HjMonth and HjMonthEnd */
|
||||||
[rule setNamedValue: @"bymonthday"
|
[rule
|
||||||
to: [NSString stringWithFormat: @"%d",
|
setSingleValue: [NSString stringWithFormat: @"%d",
|
||||||
rp->PatternTypeSpecific.Day]];
|
rp->PatternTypeSpecific.Day]
|
||||||
|
forKey: @"bymonthday"];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
[self errorWithFormat: @"invalid value for PatternType: %.4x",
|
[self errorWithFormat: @"invalid value for PatternType: %.4x",
|
||||||
|
@ -305,6 +311,14 @@
|
||||||
rp->FirstDateTime = [moduloDate asMinutesSince1601];
|
rp->FirstDateTime = [moduloDate asMinutesSince1601];
|
||||||
|
|
||||||
byMonthDay = [[self byMonthDay] objectAtIndex: 0];
|
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)
|
||||||
{
|
{
|
||||||
if ([byMonthDay intValue] < 0)
|
if ([byMonthDay intValue] < 0)
|
||||||
|
@ -325,15 +339,18 @@
|
||||||
{
|
{
|
||||||
rp->PatternType = PatternType_MonthNth;
|
rp->PatternType = PatternType_MonthNth;
|
||||||
byDayMask = [self byDayMask];
|
byDayMask = [self byDayMask];
|
||||||
days = [byDayMask weekDayOccurrences];
|
|
||||||
mask = 0;
|
mask = 0;
|
||||||
for (count = 0; count < 7; count++)
|
days = [byDayMask weekDayOccurrences];
|
||||||
if (days[0][count])
|
if (days)
|
||||||
mask |= 1 << count;
|
{
|
||||||
|
for (count = 0; count < 7; count++)
|
||||||
|
if (days[0][count])
|
||||||
|
mask |= 1 << count;
|
||||||
|
}
|
||||||
if (mask)
|
if (mask)
|
||||||
{
|
{
|
||||||
rp->PatternTypeSpecific.MonthRecurrencePattern.WeekRecurrencePattern = mask;
|
rp->PatternTypeSpecific.MonthRecurrencePattern.WeekRecurrencePattern = mask;
|
||||||
bySetPos = [self namedValue: @"bysetpos"];
|
bySetPos = [self flattenedValuesForKey: @"bysetpos"];
|
||||||
if ([bySetPos length])
|
if ([bySetPos length])
|
||||||
rp->PatternTypeSpecific.MonthRecurrencePattern.N
|
rp->PatternTypeSpecific.MonthRecurrencePattern.N
|
||||||
= ([bySetPos hasPrefix: @"-"]
|
= ([bySetPos hasPrefix: @"-"]
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
/* MAPIStoreSamDBUtils.h - this file is part of SOGo
|
||||||
|
*
|
||||||
|
* Copyright (C) 2011 Inverse inc
|
||||||
|
*
|
||||||
|
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
*
|
||||||
|
* This file is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* This file is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; see the file COPYING. If not, write to
|
||||||
|
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
* Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef MAPISTORESAMDBUTILS_H
|
||||||
|
#define MAPISTORESAMDBUTILS_H
|
||||||
|
|
||||||
|
@class NSString;
|
||||||
|
|
||||||
|
struct ldb_context;
|
||||||
|
|
||||||
|
NSString *MAPIStoreSamDBUserAttribute (struct ldb_context *samCtx,
|
||||||
|
NSString *userKey,
|
||||||
|
NSString *value,
|
||||||
|
NSString *attributeName);
|
||||||
|
NSData *MAPIStoreInternalEntryId (struct ldb_context *, NSString *username);
|
||||||
|
NSData *MAPIStoreExternalEntryId (NSString *cn, NSString *email);
|
||||||
|
|
||||||
|
#endif /* MAPISTORESAMDBUTILS_H */
|
|
@ -0,0 +1,165 @@
|
||||||
|
/* MAPIStoreSamDBUtils.m - this file is part of SOGo
|
||||||
|
*
|
||||||
|
* Copyright (C) 2011 Inverse inc
|
||||||
|
*
|
||||||
|
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
*
|
||||||
|
* This file is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* This file is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; see the file COPYING. If not, write to
|
||||||
|
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
* Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Foundation/NSData.h>
|
||||||
|
#import <Foundation/NSString.h>
|
||||||
|
#include <talloc.h>
|
||||||
|
#include <ldb.h>
|
||||||
|
|
||||||
|
#import "NSData+MAPIStore.h"
|
||||||
|
|
||||||
|
#import "MAPIStoreSamDBUtils.h"
|
||||||
|
|
||||||
|
NSString *
|
||||||
|
MAPIStoreSamDBUserAttribute (struct ldb_context *samCtx,
|
||||||
|
NSString *userKey,
|
||||||
|
NSString *value,
|
||||||
|
NSString *attributeName)
|
||||||
|
{
|
||||||
|
NSString *resultValue = nil;
|
||||||
|
const char *attrs[] = { "", NULL };
|
||||||
|
NSString *searchFormat;
|
||||||
|
const char *result;
|
||||||
|
struct ldb_result *res = NULL;
|
||||||
|
TALLOC_CTX *memCtx;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
memCtx = talloc_zero(NULL, TALLOC_CTX);
|
||||||
|
|
||||||
|
attrs[0] = [attributeName UTF8String];
|
||||||
|
searchFormat
|
||||||
|
= [NSString stringWithFormat: @"(&(objectClass=user)(%@=%%s))", userKey];
|
||||||
|
ret = ldb_search (samCtx, memCtx, &res, ldb_get_default_basedn(samCtx),
|
||||||
|
LDB_SCOPE_SUBTREE, attrs,
|
||||||
|
[searchFormat UTF8String],
|
||||||
|
[value UTF8String]);
|
||||||
|
if (ret == LDB_SUCCESS && res->count == 1)
|
||||||
|
{
|
||||||
|
result = ldb_msg_find_attr_as_string (res->msgs[0], attrs[0], NULL);
|
||||||
|
if (result)
|
||||||
|
resultValue = [NSString stringWithUTF8String: result];
|
||||||
|
}
|
||||||
|
|
||||||
|
talloc_free (memCtx);
|
||||||
|
|
||||||
|
return resultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
NSData *
|
||||||
|
MAPIStoreInternalEntryId (struct ldb_context *samCtx, NSString *username)
|
||||||
|
{
|
||||||
|
static const uint8_t const providerUid[] = { 0xdc, 0xa7, 0x40, 0xc8,
|
||||||
|
0xc0, 0x42, 0x10, 0x1a,
|
||||||
|
0xb4, 0xb9, 0x08, 0x00,
|
||||||
|
0x2b, 0x2f, 0xe1, 0x82 };
|
||||||
|
NSMutableData *entryId;
|
||||||
|
NSData *legacyDNData;
|
||||||
|
NSString *legacyDN;
|
||||||
|
|
||||||
|
/* structure:
|
||||||
|
flags: 32
|
||||||
|
provideruid: 32 * 4
|
||||||
|
version: 32
|
||||||
|
type: 32
|
||||||
|
X500DN: variable */
|
||||||
|
|
||||||
|
legacyDN = MAPIStoreSamDBUserAttribute (samCtx, @"sAMAccountName", username,
|
||||||
|
@"legacyExchangeDN");
|
||||||
|
if (legacyDN)
|
||||||
|
{
|
||||||
|
entryId = [NSMutableData dataWithCapacity: 256];
|
||||||
|
[entryId appendUInt32: 0]; // flags
|
||||||
|
[entryId appendBytes: providerUid length: 16]; // provideruid
|
||||||
|
[entryId appendUInt32: 1]; // version
|
||||||
|
[entryId appendUInt32: 0]; // type (local mail user)
|
||||||
|
legacyDNData = [legacyDN dataUsingEncoding: NSASCIIStringEncoding];
|
||||||
|
[entryId appendData: legacyDNData]; // x500dn
|
||||||
|
[entryId appendUInt8: 0]; // end of string
|
||||||
|
}
|
||||||
|
else
|
||||||
|
entryId = nil;
|
||||||
|
|
||||||
|
return entryId;
|
||||||
|
}
|
||||||
|
|
||||||
|
NSData *
|
||||||
|
MAPIStoreExternalEntryId (NSString *cn, NSString *email)
|
||||||
|
{
|
||||||
|
NSMutableData *entryId;
|
||||||
|
static uint8_t providerUid[] = { 0x81, 0x2b, 0x1f, 0xa4,
|
||||||
|
0xbe, 0xa3, 0x10, 0x19,
|
||||||
|
0x9d, 0x6e, 0x00, 0xdd,
|
||||||
|
0x01, 0x0f, 0x54, 0x02 };
|
||||||
|
uint8_t flags21, flags22;
|
||||||
|
|
||||||
|
/* structure:
|
||||||
|
flags: 32
|
||||||
|
provideruid: 32 * 4
|
||||||
|
version: 16
|
||||||
|
{
|
||||||
|
PaD: 1
|
||||||
|
MAE: 2
|
||||||
|
Format: 4
|
||||||
|
M: 1
|
||||||
|
U: 1
|
||||||
|
R: 2
|
||||||
|
L: 1
|
||||||
|
Pad: 4
|
||||||
|
}
|
||||||
|
DisplayName: variable
|
||||||
|
AddressType: variable
|
||||||
|
EmailAddress: variable */
|
||||||
|
|
||||||
|
entryId = [NSMutableData dataWithCapacity: 256];
|
||||||
|
[entryId appendUInt32: 0]; // flags
|
||||||
|
[entryId appendBytes: providerUid length: 16]; // provideruid
|
||||||
|
[entryId appendUInt16: 0]; // version
|
||||||
|
|
||||||
|
flags21 = 0; /* PaD, MAE, R, Pad = 0 */
|
||||||
|
flags21 |= 0x16; /* Format: text and HTML */
|
||||||
|
flags21 |= 0x01; /* M: mime format */
|
||||||
|
|
||||||
|
flags22 = 0x90; /* U: unicode, L: no lookup */
|
||||||
|
[entryId appendUInt8: flags21];
|
||||||
|
[entryId appendUInt8: flags22];
|
||||||
|
|
||||||
|
/* DisplayName */
|
||||||
|
if (!cn)
|
||||||
|
cn = @"";
|
||||||
|
[entryId
|
||||||
|
appendData: [cn dataUsingEncoding: NSUTF16LittleEndianStringEncoding]];
|
||||||
|
[entryId appendUInt16: 0];
|
||||||
|
|
||||||
|
/* AddressType */
|
||||||
|
[entryId
|
||||||
|
appendData: [@"SMTP" dataUsingEncoding: NSUTF16LittleEndianStringEncoding]];
|
||||||
|
[entryId appendUInt16: 0];
|
||||||
|
|
||||||
|
/* EMailAddress */
|
||||||
|
if (!email)
|
||||||
|
email = @"";
|
||||||
|
[entryId
|
||||||
|
appendData: [email dataUsingEncoding: NSUTF16LittleEndianStringEncoding]];
|
||||||
|
[entryId appendUInt16: 0];
|
||||||
|
|
||||||
|
return entryId;
|
||||||
|
}
|
|
@ -26,6 +26,8 @@
|
||||||
#import <Foundation/NSValue.h>
|
#import <Foundation/NSValue.h>
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <talloc.h>
|
||||||
|
#include <util/time.h>
|
||||||
#include <gen_ndr/exchange.h>
|
#include <gen_ndr/exchange.h>
|
||||||
|
|
||||||
@class NSData;
|
@class NSData;
|
||||||
|
|
|
@ -20,13 +20,6 @@
|
||||||
* Boston, MA 02111-1307, USA.
|
* 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/NSArray.h>
|
||||||
#import <Foundation/NSDictionary.h>
|
#import <Foundation/NSDictionary.h>
|
||||||
#import <Foundation/NSException.h>
|
#import <Foundation/NSException.h>
|
||||||
|
@ -38,6 +31,10 @@
|
||||||
|
|
||||||
#import "MAPIStoreTypes.h"
|
#import "MAPIStoreTypes.h"
|
||||||
|
|
||||||
|
#undef DEBUG
|
||||||
|
#include <mapistore/mapistore.h>
|
||||||
|
#include <mapistore/mapistore_errors.h>
|
||||||
|
|
||||||
uint8_t *
|
uint8_t *
|
||||||
MAPIBoolValue (void *memCtx, BOOL value)
|
MAPIBoolValue (void *memCtx, BOOL value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -80,25 +80,10 @@ Class NSNumberK;
|
||||||
[super dealloc];
|
[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
|
- (void) addProperties: (NSDictionary *) newProperties
|
||||||
{
|
{
|
||||||
[super addProperties: newProperties];
|
[super addProperties: newProperties];
|
||||||
[sogoObject appendProperties: newProperties];
|
[sogoObject appendProperties: properties];
|
||||||
[properties removeAllObjects];
|
[properties removeAllObjects];
|
||||||
ASSIGN (lastModificationTime, [NSDate date]);
|
ASSIGN (lastModificationTime, [NSDate date]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
#include <talloc.h>
|
#include <talloc.h>
|
||||||
|
#include <util/time.h>
|
||||||
#include <mapistore/mapistore.h>
|
#include <mapistore/mapistore.h>
|
||||||
|
|
||||||
@implementation NSArray (MAPIStoreFolders)
|
@implementation NSArray (MAPIStoreFolders)
|
||||||
|
|
|
@ -24,8 +24,9 @@
|
||||||
|
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <gen_ndr/exchange.h>
|
|
||||||
#include <talloc.h>
|
#include <talloc.h>
|
||||||
|
#include <util/time.h>
|
||||||
|
#include <gen_ndr/exchange.h>
|
||||||
|
|
||||||
@implementation NSData (MAPIStoreDataTypes)
|
@implementation NSData (MAPIStoreDataTypes)
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,9 @@
|
||||||
#import "NSDate+MAPIStore.h"
|
#import "NSDate+MAPIStore.h"
|
||||||
|
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
#include <mapistore/mapistore.h>
|
|
||||||
#include <talloc.h>
|
#include <talloc.h>
|
||||||
|
#include <util/time.h>
|
||||||
|
#include <mapistore/mapistore.h>
|
||||||
|
|
||||||
static NSCalendarDate *refDate = nil;
|
static NSCalendarDate *refDate = nil;
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
#import "NSString+MAPIStore.h"
|
#import "NSString+MAPIStore.h"
|
||||||
|
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
|
#include <talloc.h>
|
||||||
|
#include <util/time.h>
|
||||||
#include <mapistore/mapistore.h>
|
#include <mapistore/mapistore.h>
|
||||||
|
|
||||||
@implementation NSString (MAPIStoreDataTypes)
|
@implementation NSString (MAPIStoreDataTypes)
|
||||||
|
|
|
@ -35,6 +35,8 @@
|
||||||
#import "SOGoMAPIFSFolder.h"
|
#import "SOGoMAPIFSFolder.h"
|
||||||
|
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
|
#include <talloc.h>
|
||||||
|
#include <util/time.h>
|
||||||
#include <mapistore/mapistore.h>
|
#include <mapistore/mapistore.h>
|
||||||
#include <mapistore/mapistore_errors.h>
|
#include <mapistore/mapistore_errors.h>
|
||||||
#include <libmapiproxy.h>
|
#include <libmapiproxy.h>
|
||||||
|
|
|
@ -81,6 +81,8 @@ h_template = """/* %(filename)s (auto-generated) - this file is part of SOGo
|
||||||
#import <Foundation/NSObjCRuntime.h>
|
#import <Foundation/NSObjCRuntime.h>
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <talloc.h>
|
||||||
|
#include <util/time.h>
|
||||||
#include <gen_ndr/exchange.h>
|
#include <gen_ndr/exchange.h>
|
||||||
|
|
||||||
extern const NSUInteger MAPIStorePropertyGettersCount;
|
extern const NSUInteger MAPIStorePropertyGettersCount;
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
@ -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 */
|
|
@ -1986,7 +1986,7 @@ static NSArray *childRecordFields = nil;
|
||||||
|
|
||||||
[r appendFormat: @"<D:response><D:href>"];
|
[r appendFormat: @"<D:response><D:href>"];
|
||||||
[r appendString: baseURL];
|
[r appendString: baseURL];
|
||||||
[r appendString: [object objectForKey: @"c_name"]];
|
[r appendString: [[object objectForKey: @"c_name"] stringByEscapingURL]];
|
||||||
[r appendString: @"</D:href>"];
|
[r appendString: @"</D:href>"];
|
||||||
|
|
||||||
// NSLog (@"(appendPropstats...): %@", [NSDate date]);
|
// NSLog (@"(appendPropstats...): %@", [NSDate date]);
|
||||||
|
@ -2032,7 +2032,7 @@ static NSArray *childRecordFields = nil;
|
||||||
for (count = 0; count < max; count++)
|
for (count = 0; count < max; count++)
|
||||||
{
|
{
|
||||||
element = [refs objectAtIndex: count];
|
element = [refs objectAtIndex: count];
|
||||||
currentURL = [[element firstChild] nodeValue];
|
currentURL = [[[element firstChild] nodeValue] stringByUnescapingURL];
|
||||||
[urls addObject: currentURL];
|
[urls addObject: currentURL];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -629,7 +629,7 @@ static NSString *sieveScriptName = @"sogo";
|
||||||
NGSieveClient *client;
|
NGSieveClient *client;
|
||||||
NSString *filterScript, *v, *sieveServer;
|
NSString *filterScript, *v, *sieveServer;
|
||||||
int sievePort;
|
int sievePort;
|
||||||
BOOL b;
|
BOOL b, connected;
|
||||||
|
|
||||||
dd = [user domainDefaults];
|
dd = [user domainDefaults];
|
||||||
if (!([dd sieveScriptsEnabled] || [dd vacationEnabled] || [dd forwardEnabled]))
|
if (!([dd sieveScriptsEnabled] || [dd vacationEnabled] || [dd forwardEnabled]))
|
||||||
|
@ -637,6 +637,8 @@ static NSString *sieveScriptName = @"sogo";
|
||||||
|
|
||||||
req = [NSMutableArray arrayWithCapacity: 15];
|
req = [NSMutableArray arrayWithCapacity: 15];
|
||||||
ud = [user userDefaults];
|
ud = [user userDefaults];
|
||||||
|
|
||||||
|
connected = YES;
|
||||||
b = NO;
|
b = NO;
|
||||||
|
|
||||||
script = [NSMutableString string];
|
script = [NSMutableString string];
|
||||||
|
@ -793,7 +795,23 @@ static NSString *sieveScriptName = @"sogo";
|
||||||
[client closeConnection];
|
[client closeConnection];
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
result = [client login: theLogin authname: theAuthName password: thePassword];
|
|
||||||
|
NS_DURING
|
||||||
|
{
|
||||||
|
result = [client login: theLogin authname: theAuthName password: thePassword];
|
||||||
|
}
|
||||||
|
NS_HANDLER
|
||||||
|
{
|
||||||
|
connected = NO;
|
||||||
|
}
|
||||||
|
NS_ENDHANDLER
|
||||||
|
|
||||||
|
if (!connected)
|
||||||
|
{
|
||||||
|
NSLog(@"Sieve connection failed on %@", [address description]);
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
if (![[result valueForKey:@"result"] boolValue]) {
|
if (![[result valueForKey:@"result"] boolValue]) {
|
||||||
NSLog(@"failure. Attempting with a renewed password (no authname supported)");
|
NSLog(@"failure. Attempting with a renewed password (no authname supported)");
|
||||||
thePassword = [theAccount imap4PasswordRenewed: YES];
|
thePassword = [theAccount imap4PasswordRenewed: YES];
|
||||||
|
|
|
@ -282,4 +282,4 @@
|
||||||
"Password change is not supported." = "Changement de mot de passe non-supporté.";
|
"Password change is not supported." = "Changement de mot de passe non-supporté.";
|
||||||
"Unhandled HTTP error code: %{0}" = "Code HTTP non-géré: %{0}";
|
"Unhandled HTTP error code: %{0}" = "Code HTTP non-géré: %{0}";
|
||||||
"New password:" = "Nova senha:";
|
"New password:" = "Nova senha:";
|
||||||
"Confirmation:" = "Confirmação:";
|
"Confirmation:" = "Confirmação:";
|
||||||
|
|
|
@ -282,4 +282,4 @@
|
||||||
"Password change is not supported." = "Changement de mot de passe non-supporté.";
|
"Password change is not supported." = "Changement de mot de passe non-supporté.";
|
||||||
"Unhandled HTTP error code: %{0}" = "Code HTTP non-géré: %{0}";
|
"Unhandled HTTP error code: %{0}" = "Code HTTP non-géré: %{0}";
|
||||||
"New password:" = "Új jelszó:";
|
"New password:" = "Új jelszó:";
|
||||||
"Confirmation:" = "Megerősítés:";
|
"Confirmation:" = "Megerősítés:";
|
||||||
|
|
|
@ -282,4 +282,4 @@
|
||||||
"Password change is not supported." = "Changement de mot de passe non-supporté.";
|
"Password change is not supported." = "Changement de mot de passe non-supporté.";
|
||||||
"Unhandled HTTP error code: %{0}" = "Code HTTP non-géré: %{0}";
|
"Unhandled HTTP error code: %{0}" = "Code HTTP non-géré: %{0}";
|
||||||
"New password:" = "Nytt passord:";
|
"New password:" = "Nytt passord:";
|
||||||
"Confirmation:" = "Bekreft:";
|
"Confirmation:" = "Bekreft:";
|
||||||
|
|
|
@ -284,4 +284,4 @@ Servernamn:";
|
||||||
"Password change is not supported." = "Changement de mot de passe non-supporté.";
|
"Password change is not supported." = "Changement de mot de passe non-supporté.";
|
||||||
"Unhandled HTTP error code: %{0}" = "Code HTTP non-géré: %{0}";
|
"Unhandled HTTP error code: %{0}" = "Code HTTP non-géré: %{0}";
|
||||||
"New password:" = "Nytt lösenord:";
|
"New password:" = "Nytt lösenord:";
|
||||||
"Confirmation:" = "Bekräfta:";
|
"Confirmation:" = "Bekräfta:";
|
||||||
|
|
|
@ -282,4 +282,4 @@
|
||||||
"Password change is not supported." = "Changement de mot de passe non-supporté.";
|
"Password change is not supported." = "Changement de mot de passe non-supporté.";
|
||||||
"Unhandled HTTP error code: %{0}" = "Code HTTP non-géré: %{0}";
|
"Unhandled HTTP error code: %{0}" = "Code HTTP non-géré: %{0}";
|
||||||
"New password:" = "New password:";
|
"New password:" = "New password:";
|
||||||
"Confirmation:" = "Confirmation:";
|
"Confirmation:" = "Confirmation:";
|
||||||
|
|
Loading…
Reference in New Issue