Monotone-Parent: 9526db8a187e1a3f30ac4b5933d589fcb9dbbc40

Monotone-Revision: 1639c49f52eac11f85997ccaa9ebcc659f81dd46

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-08-27T16:10:51
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2009-08-27 16:10:51 +00:00
parent d72fc4792b
commit b84952e615
3 changed files with 23 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2009-08-27 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* iCalEntityObject.m (-removeFromAttendees:): new helper method to
remove a specific attendee from the list.
* NSArray+NGCards.m (-renderedForCards): empty values are not
returned, so as to avoid rendering attributes that do not have a
value.

View File

@ -106,11 +106,13 @@ typedef enum
- (void) setStatus: (NSString *) _value;
- (NSString *) status;
- (void) removeAllAttendees;
- (void) addToAttendees: (iCalPerson *) _person;
- (NSArray *) attendees;
- (void) setAttendees: (NSArray *) attendees;
- (void) removeFromAttendees: (iCalPerson *) oldAttendee;
- (void) removeAllAttendees;
/* categorize attendees into participants and resources */
- (NSArray *) participants;
- (NSArray *) resources;

View File

@ -302,6 +302,23 @@
[self addChild: _person];
}
- (void) removeFromAttendees: (iCalPerson *) oldAttendee
{
NSMutableArray *newAttendees;
int count, max;
newAttendees = [NSMutableArray arrayWithArray: [self attendees]];
max = [newAttendees count];
for (count = max - 1; count > -1; count--)
{
if ([[newAttendees objectAtIndex: count]
hasSameEmailAddress: oldAttendee])
[newAttendees removeObjectAtIndex: count];
}
[self setAttendees: newAttendees];
}
- (void) setAttendees: (NSArray *) attendees
{
[self removeAllAttendees];