Monotone-Parent: 463195ab0268a4a769eab22f23b6aecf0c87ad79

Monotone-Revision: 9abbb51cbabcad645190865841814453369fa85f

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-11-18T10:16:25
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-11-18 10:16:25 +00:00
parent e3cdb8ecbf
commit 73bfada6bf
50 changed files with 1751 additions and 1265 deletions
@@ -23,11 +23,14 @@
#import <Foundation/NSArray.h>
#import <Foundation/NSEnumerator.h>
#import <NGCards/iCalCalendar.h>
#import <NGCards/iCalPerson.h>
#import <SoObjects/SOGo/NSArray+Utilities.h>
#import <SoObjects/SOGo/SOGoUser.h>
#import "iCalPerson+SOGo.h"
#import "iCalEntityObject+SOGo.h"
@implementation iCalEntityObject (SOGoExtensions)
@@ -52,6 +55,7 @@
return isParticipant;
}
#warning user could be a delegate, we will need to handle that someday
- (BOOL) userIsOrganizer: (SOGoUser *) user
{
NSString *orgMail;
@@ -61,4 +65,66 @@
return [user hasEmail: orgMail];
}
- (NSArray *) attendeeUIDs
{
NSEnumerator *attendees;
NSString *uid;
iCalPerson *currentAttendee;
NSMutableArray *uids;
uids = [NSMutableArray array];
attendees = [[self attendees] objectEnumerator];
while ((currentAttendee = [attendees nextObject]))
{
uid = [currentAttendee uid];
if (uid)
[uids addObject: uid];
}
return uids;
}
#warning this method should be implemented in a category of iCalToDo
- (BOOL) isStillRelevant
{
[self subclassResponsibility: _cmd];
return NO;
}
- (id) itipEntryWithMethod: (NSString *) method
{
iCalCalendar *newCalendar;
iCalEntityObject *newEntry;
newCalendar = [parent mutableCopy];
[newCalendar autorelease];
[newCalendar setMethod: method];
newEntry = (iCalEntityObject *) [newCalendar firstChildWithTag: tag];
return newEntry;
}
- (NSArray *) attendeesWithoutUser: (SOGoUser *) user
{
NSMutableArray *newAttendees;
NSArray *oldAttendees;
unsigned int count, max;
iCalPerson *currentAttendee;
NSString *userID;
userID = [user login];
oldAttendees = [self attendees];
max = [oldAttendees count];
newAttendees = [NSMutableArray arrayWithCapacity: max];
for (count = 0; count < max; count++)
{
currentAttendee = [oldAttendees objectAtIndex: count];
if (![[currentAttendee uid] isEqualToString: userID])
[newAttendees addObject: currentAttendee];
}
return newAttendees;
}
@end