mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-21 14:43:31 +00:00
Monotone-Parent: ffb403989e64c7ca37321c15ab24b50155dc2f68
Monotone-Revision: fe50cf1e82dc1e3027fc400eb2f405261b9ad9f3 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-10-21T21:17:11 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -113,9 +113,18 @@ static NSString *rfc822Months[] = {@"", @"Jan", @"Feb", @"Mar", @"Apr",
|
||||
timeZoneShift];
|
||||
}
|
||||
|
||||
/* <<<<<<< variant A
|
||||
#define secondsOfDistantFuture 1073741823.0
|
||||
#define secondsOfDistantPast -1518491648.0
|
||||
>>>>>>> variant B */
|
||||
#define secondsOfDistantFuture 1073741823.0
|
||||
#define secondsOfDistantPast -1073741823.0
|
||||
|
||||
/*
|
||||
####### Ancestor
|
||||
#define secondsOfDistantFuture 63113990400.0
|
||||
#define secondsOfDistantPast -63113817600.0
|
||||
======= end */
|
||||
|
||||
+ (id) distantFuture
|
||||
{
|
||||
|
||||
@@ -374,10 +374,10 @@
|
||||
[content lengthOfBytesUsingEncoding: NSUTF8StringEncoding]];
|
||||
}
|
||||
|
||||
- (NSString *) davResourceType
|
||||
{
|
||||
return @"";
|
||||
}
|
||||
// - (NSString *) davResourceType
|
||||
// {
|
||||
// return @"";
|
||||
// }
|
||||
|
||||
- (NSException *) davMoveToTargetObject: (id) _target
|
||||
newName: (NSString *) _name
|
||||
|
||||
@@ -1065,7 +1065,7 @@ static NSArray *childRecordFields = nil;
|
||||
|
||||
newToken = 0;
|
||||
|
||||
baseURL = [[self davURL] absoluteString];
|
||||
baseURL = [self davURLAsString];
|
||||
|
||||
max = [records count];
|
||||
syncResponses = [NSMutableArray arrayWithCapacity: max + 1];
|
||||
|
||||
@@ -93,6 +93,7 @@ SEL SOGoSelectorForPropertySetter (NSString *property);
|
||||
- (NSURL *) soURL;
|
||||
- (NSURL *) soURLToBaseContainerForUser: (NSString *) uid;
|
||||
- (NSURL *) soURLToBaseContainerForCurrentUser;
|
||||
- (NSString *) davURLAsString;
|
||||
|
||||
- (NSString *) labelForKey: (NSString *) key;
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
|
||||
static BOOL kontactGroupDAV = YES;
|
||||
static BOOL sendACLAdvisories = NO;
|
||||
static BOOL useRelativeURLs = NO;
|
||||
|
||||
static NSDictionary *reportMap = nil;
|
||||
static NSMutableDictionary *setterMap = nil;
|
||||
@@ -178,6 +179,7 @@ SEL SOGoSelectorForPropertySetter (NSString *property)
|
||||
ud = [NSUserDefaults standardUserDefaults];
|
||||
kontactGroupDAV = ![ud boolForKey:@"SOGoDisableKontact34GroupDAVHack"];
|
||||
sendACLAdvisories = [ud boolForKey: @"SOGoACLsSendEMailNotifications"];
|
||||
useRelativeURLs = [ud boolForKey: @"WOUseRelativeURLs"];
|
||||
|
||||
if (!reportMap)
|
||||
{
|
||||
@@ -463,7 +465,7 @@ SEL SOGoSelectorForPropertySetter (NSString *property)
|
||||
NSString *usersUrl;
|
||||
|
||||
usersUrl = [NSString stringWithFormat: @"%@%@/",
|
||||
[[WOApplication application] davURL], owner];
|
||||
[[WOApplication application] davURLAsString], owner];
|
||||
ownerHREF = davElementWithContent (@"href", @"DAV:", usersUrl);
|
||||
|
||||
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
|
||||
use the user's principal object as a reference */
|
||||
usersUrl = [NSString stringWithFormat: @"%@%@/",
|
||||
[[WOApplication application] davURL], owner];
|
||||
[[WOApplication application] davURLAsString], owner];
|
||||
collectionHREF = davElementWithContent (@"href", @"DAV:", usersUrl);
|
||||
|
||||
return [davElementWithContent (@"principal-collection-set",
|
||||
@@ -553,7 +555,7 @@ SEL SOGoSelectorForPropertySetter (NSString *property)
|
||||
if ([roles count])
|
||||
{
|
||||
principalURL = [NSString stringWithFormat: @"%@%@/",
|
||||
[[WOApplication application] davURL],
|
||||
[[WOApplication application] davURLAsString],
|
||||
currentUID];
|
||||
userHREF = davElementWithContent (@"href", @"DAV:", principalURL);
|
||||
[currentAce addObject: davElementWithContent (@"principal", @"DAV:",
|
||||
@@ -670,7 +672,7 @@ SEL SOGoSelectorForPropertySetter (NSString *property)
|
||||
NSString *davURL, *userLogin;
|
||||
NSArray *principalURL;
|
||||
|
||||
davURL = [[WOApplication application] davURL];
|
||||
davURL = [[WOApplication application] davURLAsString];
|
||||
userLogin = [[context activeUser] login];
|
||||
principalURL
|
||||
= [NSArray arrayWithObject: [NSString stringWithFormat: @"%@%@/", davURL,
|
||||
@@ -680,15 +682,11 @@ SEL SOGoSelectorForPropertySetter (NSString *property)
|
||||
|
||||
- (void) _fillArrayWithPrincipalsOwnedBySelf: (NSMutableArray *) hrefs
|
||||
{
|
||||
NSString *url;
|
||||
NSArray *roles;
|
||||
|
||||
roles = [[context activeUser] rolesForObject: self inContext: context];
|
||||
if ([roles containsObject: SoRole_Owner])
|
||||
{
|
||||
url = [[self davURL] absoluteString];
|
||||
[hrefs addObject: url];
|
||||
}
|
||||
[hrefs addObject: [self davURLAsString]];
|
||||
}
|
||||
|
||||
- (NSDictionary *)
|
||||
@@ -1189,6 +1187,15 @@ SEL SOGoSelectorForPropertySetter (NSString *property)
|
||||
return [self _urlPreferringParticle: @"dav" overThisOne: @"so"];
|
||||
}
|
||||
|
||||
- (NSString *) davURLAsString
|
||||
{
|
||||
NSURL *davURL;
|
||||
|
||||
davURL = [self davURL];
|
||||
|
||||
return (useRelativeURLs ? [davURL path] : [davURL absoluteString]);
|
||||
}
|
||||
|
||||
- (NSURL *) soURL
|
||||
{
|
||||
return [self _urlPreferringParticle: @"so" overThisOne: @"dav"];
|
||||
|
||||
@@ -261,7 +261,7 @@ static NSString *LDAPContactInfoAttribute = nil;
|
||||
NSEnumerator *foldersEnum;
|
||||
SOGoUser *ownerUser;
|
||||
|
||||
baseHREF = [[container davURL] absoluteString];
|
||||
baseHREF = [container davURLAsString];
|
||||
if ([baseHREF hasSuffix: @"/"])
|
||||
baseHREF = [baseHREF substringToIndex: [baseHREF length] - 1];
|
||||
foldersEnum = [folders objectEnumerator];
|
||||
@@ -617,11 +617,9 @@ static NSString *LDAPContactInfoAttribute = nil;
|
||||
- (NSArray *) davPrincipalURL
|
||||
{
|
||||
NSArray *principalURL;
|
||||
NSString *selfDAVPath;
|
||||
|
||||
selfDAVPath = [[self davURL] path];
|
||||
principalURL = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
|
||||
selfDAVPath, nil];
|
||||
[self davURLAsString], nil];
|
||||
|
||||
return [NSArray arrayWithObject: principalURL];
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
- (BOOL) isAppleDAVWithSubstring: (NSString *) osSubstring;
|
||||
- (BOOL) isIPhone;
|
||||
- (BOOL) isICal;
|
||||
- (BOOL) isICal4;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -131,4 +131,9 @@
|
||||
return [self isAppleDAVWithSubstring: @"Mac OS X/10."];
|
||||
}
|
||||
|
||||
- (BOOL) isICal4
|
||||
{
|
||||
return [self isAppleDAVWithSubstring: @"iCal/4."];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user