diff --git a/ChangeLog b/ChangeLog index a96d48cbd..feb01b6b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-04-14 Wolfgang Sourdeau + + * 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 * UI/SOGoUI/SOGoACLAdvisory.m ([SOGoACLAdvisory -resourceName]): diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 7824aca9d..b77600347 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -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;