From 5ea4891a28a9abff34d1545c350cb979370b9a7c Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 13 Nov 2008 13:41:43 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: ad53dc521ff4231b5a6c7a7185ce6deda193e7e8 Monotone-Revision: f84e4aaa7eb033904461e3ce48ce2ff0919a7a30 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2008-11-13T13:41:43 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 10 ++++++++++ SoObjects/Appointments/SOGoAppointmentObject.m | 17 +++++++++++++++-- SoObjects/SOGo/SOGoUserFolder.m | 11 ++++++----- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 11128739b..60ca418f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-11-13 Ludovic Marcotte + + * SoObjects/Appointments/SOGoAppointmentObject.m + We now remove the SENT-BY when updating attendees + if it's the attendee himself that changes his + particpation status + * SoObjects/SOGo/SOGoUserFolder.m + Improve the comparison of strings by rather using + URL objects. + 2008-11-11 Ludovic Marcotte * Fixed a couple of issues in the new pref caching diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index bdb479026..31ec2ef0c 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -410,7 +410,14 @@ [otherAttendee addAttribute: @"SENT-BY" value: [NSString stringWithFormat: @"\"MAILTO:%@\"", currentEmail]]; } - + else + { + // We must REMOVE any SENT-BY here. This is important since if A accepted + // the event for B and then, B changes by himself his participation status, + // we don't want to keep the previous SENT-BY attribute there. + [(NSMutableDictionary *)[otherAttendee attributes] removeObjectForKey: @"SENT-BY"]; + } + iCalString = [[event parent] versitString]; error = [eventObject saveContentString: iCalString]; } @@ -453,6 +460,13 @@ [attendee addAttribute: @"SENT-BY" value: [NSString stringWithFormat: @"\"MAILTO:%@\"", currentEmail]]; } + else + { + // We must REMOVE any SENT-BY here. This is important since if A accepted + // the event for B and then, B changes by himself his participation status, + // we don't want to keep the previous SENT-BY attribute there. + [(NSMutableDictionary *)[attendee attributes] removeObjectForKey: @"SENT-BY"]; + } // We generate the updated iCalendar file and we save it // in the database. @@ -690,7 +704,6 @@ iCalPerson *attendee, *person; SOGoAppointmentObject *recipientEvent; SOGoUser *ownerUser; - NSString *email; elements = [NSMutableArray array]; event = [self component: NO secure: NO]; diff --git a/SoObjects/SOGo/SOGoUserFolder.m b/SoObjects/SOGo/SOGoUserFolder.m index 3026658d4..cfad1fb47 100644 --- a/SoObjects/SOGo/SOGoUserFolder.m +++ b/SoObjects/SOGo/SOGoUserFolder.m @@ -271,14 +271,15 @@ - (void) _appendCollectionsMatchingFilter: (NSDictionary *) filter toResponse: (WOResponse *) r { - NSString *prefix, *queryOwner, *uid; + NSURL *prefix, *queryOwner; NSDictionary *folders; + NSString *uid; - prefix = [self _baseDAVURLWithSuffix: @"users/"]; - queryOwner = [filter objectForKey: @"owner"]; - if ([queryOwner hasPrefix: prefix]) + prefix = [NSURL URLWithString: [self _baseDAVURLWithSuffix: @"users/"]]; + queryOwner = [NSURL URLWithString: [filter objectForKey: @"owner"]]; + if ([[queryOwner relativePath] hasPrefix: [prefix relativePath]]) { - uid = [queryOwner substringFromIndex: [prefix length]]; + uid = [[queryOwner relativePath] lastPathComponent]; folders = [self foldersOfType: [filter objectForKey: @"resource-type"] matchingUID: uid]; [self _appendFolders: folders toResponse: r];