Monotone-Parent: f6d042dc3889e0377296ef4de7738ca4cb2569d9

Monotone-Revision: 0508e0037d1a44a60737fdd18b1830b167d7ab72

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-04-14T23:27:00
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2008-04-14 23:27:00 +00:00
parent 13b3344aba
commit 1047e26fe8
2 changed files with 28 additions and 9 deletions

View File

@@ -1,3 +1,9 @@
2008-04-14 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Appointments/SOGoAppointmentFolder.m ([SOGoAppointmentFolder -davCalendarQuery:queryContext])
([SOGoAppointmentFolder -davCalendarMultiget:queryContext]):
deduce the cname of objects even if we are using hostless urls.
2008-03-31 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/SOGoUI/SOGoACLAdvisory.m ([SOGoACLAdvisory -resourceName]):

View File

@@ -494,16 +494,29 @@ static NSNumber *sharedYes = nil;
component = nil;
realBaseURL = [NSURL URLWithString: baseURL];
componentURL = [[NSURL URLWithString: url
relativeToURL: realBaseURL]
standardizedURL];
componentURLPath = [componentURL absoluteString];
if ([componentURLPath rangeOfString: [realBaseURL absoluteString]].location
!= NSNotFound)
if (realBaseURL) /* url has a host part */
{
urlComponents = [componentURLPath componentsSeparatedByString: @"/"];
cName = [urlComponents objectAtIndex: [urlComponents count] - 1];
component = [NSDictionary dictionaryWithObject: cName forKey: @"c_name"];
componentURL = [[NSURL URLWithString: url
relativeToURL: realBaseURL]
standardizedURL];
componentURLPath = [componentURL absoluteString];
if ([componentURLPath rangeOfString: [realBaseURL absoluteString]].location
!= NSNotFound)
{
urlComponents = [componentURLPath componentsSeparatedByString: @"/"];
cName = [urlComponents objectAtIndex: [urlComponents count] - 1];
component = [NSDictionary dictionaryWithObject: cName forKey: @"c_name"];
}
}
else
{
if ([url hasPrefix: baseURL])
{
urlComponents = [[url stringByDeletingPrefix: baseURL]
componentsSeparatedByString: @"/"];
cName = [urlComponents objectAtIndex: [urlComponents count] - 1];
component = [NSDictionary dictionaryWithObject: cName forKey: @"c_name"];
}
}
return component;