Monotone-Parent: ffb403989e64c7ca37321c15ab24b50155dc2f68
Monotone-Revision: fe50cf1e82dc1e3027fc400eb2f405261b9ad9f3 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-10-21T21:17:11 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
98a48a1c53
commit
8bbe631dac
20
ChangeLog
20
ChangeLog
|
@ -1,3 +1,23 @@
|
||||||
|
2009-10-21 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* SoObjects/Appointments/SOGoAppointmentFolder.m
|
||||||
|
(-davCalendarTimeZone): new DAV accessor that returns the
|
||||||
|
user's timezone.
|
||||||
|
|
||||||
|
* SoObjects/Appointments/SOGoUserFolder+Appointments.m
|
||||||
|
(-davCalendarScheduleInboxURL, davCalendarScheduleOutboxURL):
|
||||||
|
return nil if used with iCal 4.
|
||||||
|
|
||||||
|
* SoObjects/SOGo/SOGoContentObject.m (-davResourceType): removed
|
||||||
|
useless method.
|
||||||
|
|
||||||
|
* SoObjects/SOGo/SOGoObject.m (-davURLAsString): new method that
|
||||||
|
returns the resource url as a string, by taking WOUseRelativeURLs
|
||||||
|
into account.
|
||||||
|
|
||||||
|
* SoObjects/SOGo/WORequest+SOGo.m (-isICal4): new method that
|
||||||
|
determines whether to work-around iCal4 calamities.
|
||||||
|
|
||||||
2009-10-20 Ludovic Marcotte <lmarcotte@inverse.ca>
|
2009-10-20 Ludovic Marcotte <lmarcotte@inverse.ca>
|
||||||
|
|
||||||
* Added missing timezones
|
* Added missing timezones
|
||||||
|
|
|
@ -39,6 +39,8 @@
|
||||||
- (NSDictionary *) currentLocaleConsideringLanguages:(NSArray *)_langs;
|
- (NSDictionary *) currentLocaleConsideringLanguages:(NSArray *)_langs;
|
||||||
- (NSDictionary *) localeForLanguageNamed:(NSString *)_name;
|
- (NSDictionary *) localeForLanguageNamed:(NSString *)_name;
|
||||||
|
|
||||||
|
- (NSString *) davURLAsString;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif /* MAIN_SOGO_H */
|
#endif /* MAIN_SOGO_H */
|
||||||
|
|
11
Main/SOGo.m
11
Main/SOGo.m
|
@ -67,6 +67,7 @@ static BOOL doCrashOnSessionCreate = NO;
|
||||||
static BOOL hasCheckedTables = NO;
|
static BOOL hasCheckedTables = NO;
|
||||||
static BOOL debugRequests = NO;
|
static BOOL debugRequests = NO;
|
||||||
static BOOL debugLeaks = NO;
|
static BOOL debugLeaks = NO;
|
||||||
|
static BOOL useRelativeURLs = NO;
|
||||||
|
|
||||||
static BOOL trustProxyAuthentication;
|
static BOOL trustProxyAuthentication;
|
||||||
|
|
||||||
|
@ -125,6 +126,7 @@ static BOOL debugObjectAllocation = NO;
|
||||||
[sInfo declareRoles: basicRoles asDefaultForPermission: SoPerm_WebDAVAccess];
|
[sInfo declareRoles: basicRoles asDefaultForPermission: SoPerm_WebDAVAccess];
|
||||||
|
|
||||||
trustProxyAuthentication = [ud boolForKey: @"SOGoTrustProxyAuthentication"];
|
trustProxyAuthentication = [ud boolForKey: @"SOGoTrustProxyAuthentication"];
|
||||||
|
useRelativeURLs = [ud boolForKey: @"WOUseRelativeURLs"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) init
|
- (id) init
|
||||||
|
@ -607,6 +609,15 @@ static BOOL debugObjectAllocation = NO;
|
||||||
return [self _urlPreferringParticle: @"dav" overThisOne: @"so"];
|
return [self _urlPreferringParticle: @"dav" overThisOne: @"so"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *) davURLAsString
|
||||||
|
{
|
||||||
|
NSURL *davURL;
|
||||||
|
|
||||||
|
davURL = [self davURL];
|
||||||
|
|
||||||
|
return (useRelativeURLs ? [davURL path] : [davURL absoluteString]);
|
||||||
|
}
|
||||||
|
|
||||||
- (NSURL *) soURL
|
- (NSURL *) soURL
|
||||||
{
|
{
|
||||||
return [self _urlPreferringParticle: @"so" overThisOne: @"dav"];
|
return [self _urlPreferringParticle: @"so" overThisOne: @"dav"];
|
||||||
|
|
3
NEWS
3
NEWS
|
@ -8,7 +8,8 @@
|
||||||
- a context menu is now available for tasks
|
- a context menu is now available for tasks
|
||||||
- added the capability of creating and managing lists of contacts (same as in Thunderbird)
|
- added the capability of creating and managing lists of contacts (same as in Thunderbird)
|
||||||
- added support for short date format in the calendar views
|
- added support for short date format in the calendar views
|
||||||
- added support for iCal delegation
|
- added support for iCal delegation (iCal 3)
|
||||||
|
- added preliminary support for iCal 4
|
||||||
- rewrote dTree.js to include major optimizations
|
- rewrote dTree.js to include major optimizations
|
||||||
- added WebAuth support
|
- added WebAuth support
|
||||||
- added support for remote ICS subscriptions
|
- added support for remote ICS subscriptions
|
||||||
|
|
|
@ -4315,7 +4315,13 @@ Index: sope-appserver/NGObjWeb/ChangeLog
|
||||||
===================================================================
|
===================================================================
|
||||||
--- sope-appserver/NGObjWeb/ChangeLog (revision 1660)
|
--- sope-appserver/NGObjWeb/ChangeLog (revision 1660)
|
||||||
+++ sope-appserver/NGObjWeb/ChangeLog (working copy)
|
+++ sope-appserver/NGObjWeb/ChangeLog (working copy)
|
||||||
@@ -1,3 +1,22 @@
|
@@ -1,3 +1,28 @@
|
||||||
|
+2009-10-21 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
+
|
||||||
|
+ * WebDAV/SoObjectResultEntry.m (-valueForKey:): we now take
|
||||||
|
+ WOUseRelativeURLs into account when the "href" key is requested,
|
||||||
|
+ to work around a bug in iCal 4.
|
||||||
|
+
|
||||||
+2009-07-02 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
+2009-07-02 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
+
|
+
|
||||||
+ * WOMessage.m (-setHeaders:, -setHeader:forKey:, headerForKey:,
|
+ * WOMessage.m (-setHeaders:, -setHeader:forKey:, headerForKey:,
|
||||||
|
@ -4338,6 +4344,77 @@ Index: sope-appserver/NGObjWeb/ChangeLog
|
||||||
2009-06-10 Helge Hess <helge.hess@opengroupware.org>
|
2009-06-10 Helge Hess <helge.hess@opengroupware.org>
|
||||||
|
|
||||||
* DAVPropMap.plist: mapped {DAV:}current-user-principal (v4.9.37)
|
* DAVPropMap.plist: mapped {DAV:}current-user-principal (v4.9.37)
|
||||||
|
Index: sope-appserver/NGObjWeb/DAVPropMap.plist
|
||||||
|
===================================================================
|
||||||
|
--- sope-appserver/NGObjWeb/DAVPropMap.plist (revision 1660)
|
||||||
|
+++ sope-appserver/NGObjWeb/DAVPropMap.plist (working copy)
|
||||||
|
@@ -157,6 +157,7 @@
|
||||||
|
"{urn:ietf:params:xml:ns:caldav}supported-calendar-data" =
|
||||||
|
davSupportedCalendarDataTypes;
|
||||||
|
"{urn:ietf:params:xml:ns:caldav}calendar-description" = davDescription;
|
||||||
|
+ "{urn:ietf:params:xml:ns:caldav}calendar-timezone" = davCalendarTimeZone;
|
||||||
|
|
||||||
|
/* CardDAV */
|
||||||
|
"{urn:ietf:params:xml:ns:carddav}addressbook-home-set" = davAddressbookHomeSet;
|
||||||
|
Index: sope-appserver/NGObjWeb/WebDAV/SoObjectResultEntry.m
|
||||||
|
===================================================================
|
||||||
|
--- sope-appserver/NGObjWeb/WebDAV/SoObjectResultEntry.m (revision 1660)
|
||||||
|
+++ sope-appserver/NGObjWeb/WebDAV/SoObjectResultEntry.m (working copy)
|
||||||
|
@@ -25,7 +25,14 @@
|
||||||
|
@implementation SoObjectResultEntry
|
||||||
|
|
||||||
|
static BOOL debugOn = NO;
|
||||||
|
+static BOOL useRelativeURLs = NO;
|
||||||
|
|
||||||
|
++ (void) initialize
|
||||||
|
+{
|
||||||
|
+ useRelativeURLs = [[NSUserDefaults standardUserDefaults]
|
||||||
|
+ boolForKey: @"WOUseRelativeURLs"];
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
- (id)initWithURI:(NSString *)_href object:(id)_o values:(NSDictionary *)_d {
|
||||||
|
if ((self = [super init])) {
|
||||||
|
if (debugOn) {
|
||||||
|
@@ -85,10 +92,36 @@
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
+- (NSString *)_relativeHREF {
|
||||||
|
+ NSString *newHREF;
|
||||||
|
+ NSRange hostRange;
|
||||||
|
+
|
||||||
|
+ if ([self->href hasPrefix: @"/"])
|
||||||
|
+ return self->href;
|
||||||
|
+ else {
|
||||||
|
+ hostRange = [self->href rangeOfString: @"://"];
|
||||||
|
+ if (hostRange.length > 0) {
|
||||||
|
+ newHREF = [self->href substringFromIndex: NSMaxRange (hostRange)];
|
||||||
|
+ hostRange = [newHREF rangeOfString: @"/"];
|
||||||
|
+ if (hostRange.length > 0) {
|
||||||
|
+ newHREF = [newHREF substringFromIndex: hostRange.location];
|
||||||
|
+ }
|
||||||
|
+ } else {
|
||||||
|
+ newHREF = self->href;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return newHREF;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
- (id)valueForKey:(NSString *)_key {
|
||||||
|
- if ([_key isEqualToString:@"{DAV:}href"])
|
||||||
|
- return self->href;
|
||||||
|
-
|
||||||
|
+ if ([_key isEqualToString:@"{DAV:}href"]) {
|
||||||
|
+ if (useRelativeURLs)
|
||||||
|
+ return [self _relativeHREF];
|
||||||
|
+ else
|
||||||
|
+ return self->href;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if ([_key isEqualToString:@"{DAV:}status"])
|
||||||
|
return nil;
|
||||||
|
|
||||||
Index: sope-appserver/NGObjWeb/WebDAV/SoWebDAVRenderer.m
|
Index: sope-appserver/NGObjWeb/WebDAV/SoWebDAVRenderer.m
|
||||||
===================================================================
|
===================================================================
|
||||||
--- sope-appserver/NGObjWeb/WebDAV/SoWebDAVRenderer.m (revision 1660)
|
--- sope-appserver/NGObjWeb/WebDAV/SoWebDAVRenderer.m (revision 1660)
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
#import <NGCards/iCalDateTime.h>
|
#import <NGCards/iCalDateTime.h>
|
||||||
#import <NGCards/iCalPerson.h>
|
#import <NGCards/iCalPerson.h>
|
||||||
#import <NGCards/iCalRecurrenceCalculator.h>
|
#import <NGCards/iCalRecurrenceCalculator.h>
|
||||||
|
#import <NGCards/iCalTimeZone.h>
|
||||||
#import <NGCards/NSString+NGCards.h>
|
#import <NGCards/NSString+NGCards.h>
|
||||||
#import <NGExtensions/NGCalendarDateRange.h>
|
#import <NGExtensions/NGCalendarDateRange.h>
|
||||||
#import <NGExtensions/NSNull+misc.h>
|
#import <NGExtensions/NSNull+misc.h>
|
||||||
|
@ -1674,6 +1675,24 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
||||||
|
|
||||||
- (NSException *) setDavCalendarOrder: (NSString *) newColor
|
- (NSException *) setDavCalendarOrder: (NSString *) newColor
|
||||||
{
|
{
|
||||||
|
/* we fail silently */
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) davCalendarTimeZone
|
||||||
|
{
|
||||||
|
SOGoUser *ownerUser;
|
||||||
|
NSString *ownerTimeZone;
|
||||||
|
|
||||||
|
ownerUser = [SOGoUser userWithLogin: [self ownerInContext: context]];
|
||||||
|
ownerTimeZone = [[ownerUser timeZone] name];
|
||||||
|
|
||||||
|
return [[iCalTimeZone timeZoneForName: ownerTimeZone] versitString];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSException *) setDavCalendarTimeZone: (NSString *) newTimeZone
|
||||||
|
{
|
||||||
|
/* we fail silently */
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1687,8 +1706,9 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
||||||
response = [NSMutableArray array];
|
response = [NSMutableArray array];
|
||||||
subFolders = [[container subFolders] objectEnumerator];
|
subFolders = [[container subFolders] objectEnumerator];
|
||||||
while ((currentFolder = [subFolders nextObject]))
|
while ((currentFolder = [subFolders nextObject]))
|
||||||
[response addObject: davElementWithContent (@"href", XMLNS_WEBDAV,
|
[response
|
||||||
[currentFolder davURL])];
|
addObject: davElementWithContent (@"href", XMLNS_WEBDAV,
|
||||||
|
[currentFolder davURLAsString])];
|
||||||
responseValue = [davElementWithContent (@"calendar-free-busy-set", XMLNS_CALDAV, response)
|
responseValue = [davElementWithContent (@"calendar-free-busy-set", XMLNS_CALDAV, response)
|
||||||
asWebDAVValue];
|
asWebDAVValue];
|
||||||
|
|
||||||
|
@ -1720,7 +1740,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
||||||
while ((currentField = [addFields nextObject]))
|
while ((currentField = [addFields nextObject]))
|
||||||
if ([currentField length])
|
if ([currentField length])
|
||||||
[fields addObjectUniquely: currentField];
|
[fields addObjectUniquely: currentField];
|
||||||
baseURL = [[self davURL] absoluteString];
|
baseURL = [self davURLAsString];
|
||||||
|
|
||||||
propertiesArray = [[properties allKeys] asPointersOfObjects];
|
propertiesArray = [[properties allKeys] asPointersOfObjects];
|
||||||
propertiesCount = [properties count];
|
propertiesCount = [properties count];
|
||||||
|
@ -1813,7 +1833,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
||||||
max = [urls count];
|
max = [urls count];
|
||||||
cNames = [NSMutableDictionary dictionaryWithCapacity: max];
|
cNames = [NSMutableDictionary dictionaryWithCapacity: max];
|
||||||
baseURL = [self davURL];
|
baseURL = [self davURL];
|
||||||
baseURLString = [baseURL absoluteString];
|
baseURLString = [self davURLAsString];
|
||||||
|
|
||||||
for (count = 0; count < max; count++)
|
for (count = 0; count < max; count++)
|
||||||
{
|
{
|
||||||
|
@ -1939,7 +1959,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
||||||
unsigned int count, max, propertiesCount;
|
unsigned int count, max, propertiesCount;
|
||||||
NSEnumerator *addFields;
|
NSEnumerator *addFields;
|
||||||
|
|
||||||
baseURL = [[self davURL] absoluteString];
|
baseURL = [self davURLAsString];
|
||||||
|
|
||||||
urls = [NSMutableArray array];
|
urls = [NSMutableArray array];
|
||||||
max = [refs length];
|
max = [refs length];
|
||||||
|
@ -2358,7 +2378,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
||||||
resourcetype. Anything else will prevent the iPhone from querying the
|
resourcetype. Anything else will prevent the iPhone from querying the
|
||||||
collection. */
|
collection. */
|
||||||
request = [context request];
|
request = [context request];
|
||||||
if (![request isIPhone])
|
if (!([request isIPhone] || [request isICal4]))
|
||||||
{
|
{
|
||||||
gdRT = [self groupDavResourceType];
|
gdRT = [self groupDavResourceType];
|
||||||
gdVEventCol = [NSArray arrayWithObjects: [gdRT objectAtIndex: 0],
|
gdVEventCol = [NSArray arrayWithObjects: [gdRT objectAtIndex: 0],
|
||||||
|
|
|
@ -35,6 +35,8 @@
|
||||||
#import <SOGo/NSObject+DAV.h>
|
#import <SOGo/NSObject+DAV.h>
|
||||||
#import <SOGo/NSString+DAV.h>
|
#import <SOGo/NSString+DAV.h>
|
||||||
|
|
||||||
|
#import <SOGo/WORequest+SOGo.h>
|
||||||
|
|
||||||
#import "SOGoAppointmentFolders.h"
|
#import "SOGoAppointmentFolders.h"
|
||||||
#import "SOGoUserFolder+Appointments.h"
|
#import "SOGoUserFolder+Appointments.h"
|
||||||
|
|
||||||
|
@ -88,7 +90,7 @@
|
||||||
|
|
||||||
parent = [self privateCalendars: @"Calendar" inContext: context];
|
parent = [self privateCalendars: @"Calendar" inContext: context];
|
||||||
tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
|
tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
|
||||||
[[parent davURL] path], nil];
|
[parent davURLAsString], nil];
|
||||||
|
|
||||||
return [NSArray arrayWithObject: tag];
|
return [NSArray arrayWithObject: tag];
|
||||||
}
|
}
|
||||||
|
@ -100,7 +102,8 @@
|
||||||
|
|
||||||
parent = [self privateCalendars: @"Calendar" inContext: context];
|
parent = [self privateCalendars: @"Calendar" inContext: context];
|
||||||
tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
|
tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
|
||||||
[NSString stringWithFormat: @"%@personal/", [[parent davURL] path]],
|
[NSString stringWithFormat: @"%@personal/",
|
||||||
|
[parent davURLAsString]],
|
||||||
nil];
|
nil];
|
||||||
|
|
||||||
return [NSArray arrayWithObject: tag];
|
return [NSArray arrayWithObject: tag];
|
||||||
|
@ -108,22 +111,50 @@
|
||||||
|
|
||||||
- (NSArray *) davCalendarScheduleInboxURL
|
- (NSArray *) davCalendarScheduleInboxURL
|
||||||
{
|
{
|
||||||
return [self _davPersonalCalendarURL];
|
NSArray *url;
|
||||||
|
|
||||||
|
if ([[context request] isICal4])
|
||||||
|
url = nil;
|
||||||
|
else
|
||||||
|
url = [self _davPersonalCalendarURL];
|
||||||
|
|
||||||
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSArray *) davCalendarScheduleOutboxURL
|
- (NSArray *) davCalendarScheduleOutboxURL
|
||||||
{
|
{
|
||||||
return [self _davPersonalCalendarURL];
|
NSArray *url;
|
||||||
|
|
||||||
|
if ([[context request] isICal4])
|
||||||
|
url = nil;
|
||||||
|
else
|
||||||
|
url = [self _davPersonalCalendarURL];
|
||||||
|
|
||||||
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSArray *) davDropboxHomeURL
|
- (NSArray *) davDropboxHomeURL
|
||||||
{
|
{
|
||||||
return [self _davPersonalCalendarURL];
|
NSArray *url;
|
||||||
|
|
||||||
|
if ([[context request] isICal4])
|
||||||
|
url = nil;
|
||||||
|
else
|
||||||
|
url = [self _davPersonalCalendarURL];
|
||||||
|
|
||||||
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSArray *) davNotificationsURL
|
- (NSArray *) davNotificationsURL
|
||||||
{
|
{
|
||||||
return [self _davPersonalCalendarURL];
|
NSArray *url;
|
||||||
|
|
||||||
|
if ([[context request] isICal4])
|
||||||
|
url = nil;
|
||||||
|
else
|
||||||
|
url = [self _davPersonalCalendarURL];
|
||||||
|
|
||||||
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (WOResponse *) _prepareResponseFromContext: (WOContext *) queryContext
|
- (WOResponse *) _prepareResponseFromContext: (WOContext *) queryContext
|
||||||
|
@ -329,7 +360,7 @@
|
||||||
|
|
||||||
response = [NSMutableArray array];
|
response = [NSMutableArray array];
|
||||||
[response addObject: davElementWithContent (@"href", XMLNS_WEBDAV,
|
[response addObject: davElementWithContent (@"href", XMLNS_WEBDAV,
|
||||||
[collection davURL])];
|
[collection davURLAsString])];
|
||||||
props = [NSMutableArray array];
|
props = [NSMutableArray array];
|
||||||
max = [properties count];
|
max = [properties count];
|
||||||
for (count = 0; count < max; count++)
|
for (count = 0; count < max; count++)
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
|
|
||||||
parent = [self privateContacts: @"Contacts" inContext: context];
|
parent = [self privateContacts: @"Contacts" inContext: context];
|
||||||
tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
|
tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
|
||||||
[[parent davURL] path], nil];
|
[parent davURLAsString], nil];
|
||||||
|
|
||||||
return [NSArray arrayWithObject: tag];
|
return [NSArray arrayWithObject: tag];
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,9 +113,18 @@ static NSString *rfc822Months[] = {@"", @"Jan", @"Feb", @"Mar", @"Apr",
|
||||||
timeZoneShift];
|
timeZoneShift];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* <<<<<<< variant A
|
||||||
|
#define secondsOfDistantFuture 1073741823.0
|
||||||
|
#define secondsOfDistantPast -1518491648.0
|
||||||
|
>>>>>>> variant B */
|
||||||
#define secondsOfDistantFuture 1073741823.0
|
#define secondsOfDistantFuture 1073741823.0
|
||||||
#define secondsOfDistantPast -1073741823.0
|
#define secondsOfDistantPast -1073741823.0
|
||||||
|
|
||||||
|
/*
|
||||||
|
####### Ancestor
|
||||||
|
#define secondsOfDistantFuture 63113990400.0
|
||||||
|
#define secondsOfDistantPast -63113817600.0
|
||||||
|
======= end */
|
||||||
|
|
||||||
+ (id) distantFuture
|
+ (id) distantFuture
|
||||||
{
|
{
|
||||||
|
|
|
@ -374,10 +374,10 @@
|
||||||
[content lengthOfBytesUsingEncoding: NSUTF8StringEncoding]];
|
[content lengthOfBytesUsingEncoding: NSUTF8StringEncoding]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *) davResourceType
|
// - (NSString *) davResourceType
|
||||||
{
|
// {
|
||||||
return @"";
|
// return @"";
|
||||||
}
|
// }
|
||||||
|
|
||||||
- (NSException *) davMoveToTargetObject: (id) _target
|
- (NSException *) davMoveToTargetObject: (id) _target
|
||||||
newName: (NSString *) _name
|
newName: (NSString *) _name
|
||||||
|
|
|
@ -1065,7 +1065,7 @@ static NSArray *childRecordFields = nil;
|
||||||
|
|
||||||
newToken = 0;
|
newToken = 0;
|
||||||
|
|
||||||
baseURL = [[self davURL] absoluteString];
|
baseURL = [self davURLAsString];
|
||||||
|
|
||||||
max = [records count];
|
max = [records count];
|
||||||
syncResponses = [NSMutableArray arrayWithCapacity: max + 1];
|
syncResponses = [NSMutableArray arrayWithCapacity: max + 1];
|
||||||
|
|
|
@ -93,6 +93,7 @@ SEL SOGoSelectorForPropertySetter (NSString *property);
|
||||||
- (NSURL *) soURL;
|
- (NSURL *) soURL;
|
||||||
- (NSURL *) soURLToBaseContainerForUser: (NSString *) uid;
|
- (NSURL *) soURLToBaseContainerForUser: (NSString *) uid;
|
||||||
- (NSURL *) soURLToBaseContainerForCurrentUser;
|
- (NSURL *) soURLToBaseContainerForCurrentUser;
|
||||||
|
- (NSString *) davURLAsString;
|
||||||
|
|
||||||
- (NSString *) labelForKey: (NSString *) key;
|
- (NSString *) labelForKey: (NSString *) key;
|
||||||
|
|
||||||
|
|
|
@ -68,6 +68,7 @@
|
||||||
|
|
||||||
static BOOL kontactGroupDAV = YES;
|
static BOOL kontactGroupDAV = YES;
|
||||||
static BOOL sendACLAdvisories = NO;
|
static BOOL sendACLAdvisories = NO;
|
||||||
|
static BOOL useRelativeURLs = NO;
|
||||||
|
|
||||||
static NSDictionary *reportMap = nil;
|
static NSDictionary *reportMap = nil;
|
||||||
static NSMutableDictionary *setterMap = nil;
|
static NSMutableDictionary *setterMap = nil;
|
||||||
|
@ -178,6 +179,7 @@ SEL SOGoSelectorForPropertySetter (NSString *property)
|
||||||
ud = [NSUserDefaults standardUserDefaults];
|
ud = [NSUserDefaults standardUserDefaults];
|
||||||
kontactGroupDAV = ![ud boolForKey:@"SOGoDisableKontact34GroupDAVHack"];
|
kontactGroupDAV = ![ud boolForKey:@"SOGoDisableKontact34GroupDAVHack"];
|
||||||
sendACLAdvisories = [ud boolForKey: @"SOGoACLsSendEMailNotifications"];
|
sendACLAdvisories = [ud boolForKey: @"SOGoACLsSendEMailNotifications"];
|
||||||
|
useRelativeURLs = [ud boolForKey: @"WOUseRelativeURLs"];
|
||||||
|
|
||||||
if (!reportMap)
|
if (!reportMap)
|
||||||
{
|
{
|
||||||
|
@ -463,7 +465,7 @@ SEL SOGoSelectorForPropertySetter (NSString *property)
|
||||||
NSString *usersUrl;
|
NSString *usersUrl;
|
||||||
|
|
||||||
usersUrl = [NSString stringWithFormat: @"%@%@/",
|
usersUrl = [NSString stringWithFormat: @"%@%@/",
|
||||||
[[WOApplication application] davURL], owner];
|
[[WOApplication application] davURLAsString], owner];
|
||||||
ownerHREF = davElementWithContent (@"href", @"DAV:", usersUrl);
|
ownerHREF = davElementWithContent (@"href", @"DAV:", usersUrl);
|
||||||
|
|
||||||
return [davElementWithContent (@"owner", @"DAV:", ownerHREF)
|
return [davElementWithContent (@"owner", @"DAV:", ownerHREF)
|
||||||
|
@ -491,7 +493,7 @@ SEL SOGoSelectorForPropertySetter (NSString *property)
|
||||||
/* WOApplication has no support for the DAV methods we define here so we
|
/* WOApplication has no support for the DAV methods we define here so we
|
||||||
use the user's principal object as a reference */
|
use the user's principal object as a reference */
|
||||||
usersUrl = [NSString stringWithFormat: @"%@%@/",
|
usersUrl = [NSString stringWithFormat: @"%@%@/",
|
||||||
[[WOApplication application] davURL], owner];
|
[[WOApplication application] davURLAsString], owner];
|
||||||
collectionHREF = davElementWithContent (@"href", @"DAV:", usersUrl);
|
collectionHREF = davElementWithContent (@"href", @"DAV:", usersUrl);
|
||||||
|
|
||||||
return [davElementWithContent (@"principal-collection-set",
|
return [davElementWithContent (@"principal-collection-set",
|
||||||
|
@ -553,7 +555,7 @@ SEL SOGoSelectorForPropertySetter (NSString *property)
|
||||||
if ([roles count])
|
if ([roles count])
|
||||||
{
|
{
|
||||||
principalURL = [NSString stringWithFormat: @"%@%@/",
|
principalURL = [NSString stringWithFormat: @"%@%@/",
|
||||||
[[WOApplication application] davURL],
|
[[WOApplication application] davURLAsString],
|
||||||
currentUID];
|
currentUID];
|
||||||
userHREF = davElementWithContent (@"href", @"DAV:", principalURL);
|
userHREF = davElementWithContent (@"href", @"DAV:", principalURL);
|
||||||
[currentAce addObject: davElementWithContent (@"principal", @"DAV:",
|
[currentAce addObject: davElementWithContent (@"principal", @"DAV:",
|
||||||
|
@ -670,7 +672,7 @@ SEL SOGoSelectorForPropertySetter (NSString *property)
|
||||||
NSString *davURL, *userLogin;
|
NSString *davURL, *userLogin;
|
||||||
NSArray *principalURL;
|
NSArray *principalURL;
|
||||||
|
|
||||||
davURL = [[WOApplication application] davURL];
|
davURL = [[WOApplication application] davURLAsString];
|
||||||
userLogin = [[context activeUser] login];
|
userLogin = [[context activeUser] login];
|
||||||
principalURL
|
principalURL
|
||||||
= [NSArray arrayWithObject: [NSString stringWithFormat: @"%@%@/", davURL,
|
= [NSArray arrayWithObject: [NSString stringWithFormat: @"%@%@/", davURL,
|
||||||
|
@ -680,15 +682,11 @@ SEL SOGoSelectorForPropertySetter (NSString *property)
|
||||||
|
|
||||||
- (void) _fillArrayWithPrincipalsOwnedBySelf: (NSMutableArray *) hrefs
|
- (void) _fillArrayWithPrincipalsOwnedBySelf: (NSMutableArray *) hrefs
|
||||||
{
|
{
|
||||||
NSString *url;
|
|
||||||
NSArray *roles;
|
NSArray *roles;
|
||||||
|
|
||||||
roles = [[context activeUser] rolesForObject: self inContext: context];
|
roles = [[context activeUser] rolesForObject: self inContext: context];
|
||||||
if ([roles containsObject: SoRole_Owner])
|
if ([roles containsObject: SoRole_Owner])
|
||||||
{
|
[hrefs addObject: [self davURLAsString]];
|
||||||
url = [[self davURL] absoluteString];
|
|
||||||
[hrefs addObject: url];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSDictionary *)
|
- (NSDictionary *)
|
||||||
|
@ -1189,6 +1187,15 @@ SEL SOGoSelectorForPropertySetter (NSString *property)
|
||||||
return [self _urlPreferringParticle: @"dav" overThisOne: @"so"];
|
return [self _urlPreferringParticle: @"dav" overThisOne: @"so"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *) davURLAsString
|
||||||
|
{
|
||||||
|
NSURL *davURL;
|
||||||
|
|
||||||
|
davURL = [self davURL];
|
||||||
|
|
||||||
|
return (useRelativeURLs ? [davURL path] : [davURL absoluteString]);
|
||||||
|
}
|
||||||
|
|
||||||
- (NSURL *) soURL
|
- (NSURL *) soURL
|
||||||
{
|
{
|
||||||
return [self _urlPreferringParticle: @"so" overThisOne: @"dav"];
|
return [self _urlPreferringParticle: @"so" overThisOne: @"dav"];
|
||||||
|
|
|
@ -261,7 +261,7 @@ static NSString *LDAPContactInfoAttribute = nil;
|
||||||
NSEnumerator *foldersEnum;
|
NSEnumerator *foldersEnum;
|
||||||
SOGoUser *ownerUser;
|
SOGoUser *ownerUser;
|
||||||
|
|
||||||
baseHREF = [[container davURL] absoluteString];
|
baseHREF = [container davURLAsString];
|
||||||
if ([baseHREF hasSuffix: @"/"])
|
if ([baseHREF hasSuffix: @"/"])
|
||||||
baseHREF = [baseHREF substringToIndex: [baseHREF length] - 1];
|
baseHREF = [baseHREF substringToIndex: [baseHREF length] - 1];
|
||||||
foldersEnum = [folders objectEnumerator];
|
foldersEnum = [folders objectEnumerator];
|
||||||
|
@ -617,11 +617,9 @@ static NSString *LDAPContactInfoAttribute = nil;
|
||||||
- (NSArray *) davPrincipalURL
|
- (NSArray *) davPrincipalURL
|
||||||
{
|
{
|
||||||
NSArray *principalURL;
|
NSArray *principalURL;
|
||||||
NSString *selfDAVPath;
|
|
||||||
|
|
||||||
selfDAVPath = [[self davURL] path];
|
|
||||||
principalURL = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
|
principalURL = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
|
||||||
selfDAVPath, nil];
|
[self davURLAsString], nil];
|
||||||
|
|
||||||
return [NSArray arrayWithObject: principalURL];
|
return [NSArray arrayWithObject: principalURL];
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
- (BOOL) isAppleDAVWithSubstring: (NSString *) osSubstring;
|
- (BOOL) isAppleDAVWithSubstring: (NSString *) osSubstring;
|
||||||
- (BOOL) isIPhone;
|
- (BOOL) isIPhone;
|
||||||
- (BOOL) isICal;
|
- (BOOL) isICal;
|
||||||
|
- (BOOL) isICal4;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -131,4 +131,9 @@
|
||||||
return [self isAppleDAVWithSubstring: @"Mac OS X/10."];
|
return [self isAppleDAVWithSubstring: @"Mac OS X/10."];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL) isICal4
|
||||||
|
{
|
||||||
|
return [self isAppleDAVWithSubstring: @"iCal/4."];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in New Issue