diff --git a/ChangeLog b/ChangeLog index 0a31dbe64..0cdf1a778 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,10 @@ 2009-08-10 Wolfgang Sourdeau + * SoObjects/Appointments/iCalEntityObject+SOGo.m + (-userAsParticipant): new method that returns the "PARTICIPANT" + entity of the SOGoUser passed as parameter, if found. + * Tests/webdavlib.py (WebDAVClient._prepare_headers): fixed a typo causing the "depth" parameter to never be issued in query heades. diff --git a/SoObjects/Appointments/iCalEntityObject+SOGo.h b/SoObjects/Appointments/iCalEntityObject+SOGo.h index 5bf7e58c4..294b93030 100644 --- a/SoObjects/Appointments/iCalEntityObject+SOGo.h +++ b/SoObjects/Appointments/iCalEntityObject+SOGo.h @@ -37,6 +37,8 @@ NSNumber *iCalDistantFutureNumber; - (BOOL) userIsParticipant: (SOGoUser *) user; - (BOOL) userIsOrganizer: (SOGoUser *) user; +- (iCalPerson *) userAsParticipant: (SOGoUser *) user; + - (NSArray *) attendeeUIDs; - (BOOL) isStillRelevant; diff --git a/SoObjects/Appointments/iCalEntityObject+SOGo.m b/SoObjects/Appointments/iCalEntityObject+SOGo.m index fa2941b4a..afc6b5dd5 100644 --- a/SoObjects/Appointments/iCalEntityObject+SOGo.m +++ b/SoObjects/Appointments/iCalEntityObject+SOGo.m @@ -96,6 +96,22 @@ _computeAllDayOffset() return isParticipant; } +- (iCalPerson *) userAsParticipant: (SOGoUser *) user +{ + NSEnumerator *participants; + iCalPerson *currentParticipant, *userParticipant; + + userParticipant = nil; + + participants = [[self participants] objectEnumerator]; + while (!userParticipant + && (currentParticipant = [participants nextObject])) + if ([user hasEmail: [currentParticipant rfc822Email]]) + userParticipant = currentParticipant; + + return userParticipant; +} + - (BOOL) userIsOrganizer: (SOGoUser *) user { NSString *mail;