From 1047e26fe849f90cf65896ffb2f52e67cac8c971 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 14 Apr 2008 23:27:00 +0000 Subject: [PATCH] Monotone-Parent: f6d042dc3889e0377296ef4de7738ca4cb2569d9 Monotone-Revision: 0508e0037d1a44a60737fdd18b1830b167d7ab72 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-04-14T23:27:00 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++ .../Appointments/SOGoAppointmentFolder.m | 31 +++++++++++++------ 2 files changed, 28 insertions(+), 9 deletions(-) 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;