From 77bcf92491e5c23fbe8c37c12d7409cae70973f6 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Sat, 5 Jun 2010 04:44:02 +0000 Subject: [PATCH] Monotone-Parent: 412d6bf932c8152d0f23bb7bc6e4f75f4fd3750c Monotone-Revision: 06c16e479439d6ee1078d469cac954070da2357b Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-06-05T04:44:02 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ SoObjects/SOGo/SOGoGCSFolder.h | 2 ++ SoObjects/SOGo/SOGoGCSFolder.m | 29 +++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6f21fc601..d9506b2be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-06-05 Wolfgang Sourdeau + + * SoObjects/SOGo/SOGoGCSFolder.m (-realDavURL): new method that + returns the the owner version of the URL to the current folder. + 2010-06-04 Wolfgang Sourdeau * UI/Scheduler/UIxCalParticipationStatusView.m: removed obsolete module. diff --git a/SoObjects/SOGo/SOGoGCSFolder.h b/SoObjects/SOGo/SOGoGCSFolder.h index 6c8022786..ea3185d22 100644 --- a/SoObjects/SOGo/SOGoGCSFolder.h +++ b/SoObjects/SOGo/SOGoGCSFolder.h @@ -113,6 +113,8 @@ - (void) sendFolderAdvisoryTemplate: (NSString *) template; /* DAV */ +- (NSURL *) realDavURL; + - (NSDictionary *) davSQLFieldsTable; - (NSDictionary *) parseDAVRequestedProperties: (DOMElement *) propElement; diff --git a/SoObjects/SOGo/SOGoGCSFolder.m b/SoObjects/SOGo/SOGoGCSFolder.m index 9e8039802..a25b4a852 100644 --- a/SoObjects/SOGo/SOGoGCSFolder.m +++ b/SoObjects/SOGo/SOGoGCSFolder.m @@ -419,6 +419,35 @@ static NSArray *childRecordFields = nil; return error; } +- (NSURL *) realDavURL +{ + NSURL *realDavURL, *currentDavURL; + NSString *appName, *publicParticle, *path; + + if (isSubscription) + { + appName = [[context request] applicationName]; + if ([self isInPublicZone]) + publicParticle = @"/public"; + else + publicParticle = @""; + path = [NSString stringWithFormat: @"/%@/dav%@/%@/%@/%@/", + appName, publicParticle, + [self ownerInContext: nil], + [container nameInContainer], + [self realNameInContainer]]; + currentDavURL = [self davURL]; + realDavURL = [[NSURL alloc] initWithScheme: [currentDavURL scheme] + host: [currentDavURL host] + path: path]; + [realDavURL autorelease]; + } + else + realDavURL = [self davURL]; + + return realDavURL; +} + - (GCSFolder *) ocsFolder { GCSFolder *folder;