Monotone-Parent: fcf51dfbffeff460e370282e0f739875e3414767
Monotone-Revision: f2d1ff2e80e90f3c3d73fe6006e22ee1e9d39b01 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-05-05T13:45:18 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
da5fff77e9
commit
312ed2824f
|
@ -1,3 +1,12 @@
|
||||||
|
2010-05-05 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* iCalEntityObject.m (-resources): removed useless method.
|
||||||
|
(-nonParticipants): new method returning ATTENDEE objects having
|
||||||
|
their ROLE attribute set to "NON-PARTICIPANT".
|
||||||
|
(-isAttendee:): new method.
|
||||||
|
(-findAttendeeWithEmail): new method replacing
|
||||||
|
"findParticipantWithEmail:".
|
||||||
|
|
||||||
2010-04-28 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2010-04-28 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
* iCalRecurrenceRule.m (-iCalRepresentationForWeekDay:): made
|
* iCalRecurrenceRule.m (-iCalRepresentationForWeekDay:): made
|
||||||
|
|
|
@ -109,15 +109,16 @@ typedef enum
|
||||||
- (void) addToAttendees: (iCalPerson *) _person;
|
- (void) addToAttendees: (iCalPerson *) _person;
|
||||||
- (NSArray *) attendees;
|
- (NSArray *) attendees;
|
||||||
- (void) setAttendees: (NSArray *) attendees;
|
- (void) setAttendees: (NSArray *) attendees;
|
||||||
|
- (BOOL) isAttendee: (id) _email;
|
||||||
|
|
||||||
- (void) removeFromAttendees: (iCalPerson *) oldAttendee;
|
- (void) removeFromAttendees: (iCalPerson *) oldAttendee;
|
||||||
- (void) removeAllAttendees;
|
- (void) removeAllAttendees;
|
||||||
|
|
||||||
/* categorize attendees into participants and resources */
|
/* categorize attendees into participants and non-participants */
|
||||||
- (NSArray *) participants;
|
- (NSArray *) participants;
|
||||||
- (NSArray *) resources;
|
- (NSArray *) nonParticipants;
|
||||||
- (BOOL) isParticipant: (id) _email;
|
- (BOOL) isParticipant: (id) _email;
|
||||||
- (iCalPerson *) findParticipantWithEmail: (id) _email;
|
- (iCalPerson *) findAttendeeWithEmail: (id) email;
|
||||||
|
|
||||||
- (void) removeAllAlarms;
|
- (void) removeAllAlarms;
|
||||||
- (void) addToAlarms: (id) _alarm;
|
- (void) addToAlarms: (id) _alarm;
|
||||||
|
|
|
@ -330,6 +330,40 @@
|
||||||
return [self childrenWithTag: @"attendee"];
|
return [self childrenWithTag: @"attendee"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL) isAttendee: (id) _email
|
||||||
|
{
|
||||||
|
NSArray *attEmails;
|
||||||
|
|
||||||
|
_email = [_email lowercaseString];
|
||||||
|
attEmails = [[self attendees] valueForKey:@"rfc822Email"];
|
||||||
|
attEmails = [attEmails valueForKey: @"lowercaseString"];
|
||||||
|
return [attEmails containsObject:_email];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (iCalPerson *) findAttendeeWithEmail: (id) email
|
||||||
|
{
|
||||||
|
NSArray *attendees;
|
||||||
|
unsigned int count, max;
|
||||||
|
NSString *lowerEmail, *currentEmail;
|
||||||
|
iCalPerson *attendee, *currentAttendee;
|
||||||
|
|
||||||
|
attendee = nil;
|
||||||
|
|
||||||
|
lowerEmail = [email lowercaseString];
|
||||||
|
attendees = [self attendees];
|
||||||
|
max = [attendees count];
|
||||||
|
|
||||||
|
for (count = 0; attendee == nil && count < max; count++)
|
||||||
|
{
|
||||||
|
currentAttendee = [attendees objectAtIndex: count];
|
||||||
|
currentEmail = [[currentAttendee rfc822Email] lowercaseString];
|
||||||
|
if ([currentEmail isEqualToString: lowerEmail])
|
||||||
|
attendee = currentAttendee;
|
||||||
|
}
|
||||||
|
|
||||||
|
return attendee;
|
||||||
|
}
|
||||||
|
|
||||||
- (void) removeAllAlarms
|
- (void) removeAllAlarms
|
||||||
{
|
{
|
||||||
[children removeObjectsInArray: [self alarms]];
|
[children removeObjectsInArray: [self alarms]];
|
||||||
|
@ -406,48 +440,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/* stuff */
|
/* stuff */
|
||||||
|
|
||||||
- (NSArray *) participants
|
|
||||||
{
|
|
||||||
return [self _filteredAttendeesThinkingOfPersons: YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSArray *) resources
|
|
||||||
{
|
|
||||||
return [self _filteredAttendeesThinkingOfPersons: NO];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSArray *) _filteredAttendeesThinkingOfPersons: (BOOL) _persons
|
|
||||||
{
|
|
||||||
NSArray *list;
|
|
||||||
NSMutableArray *filtered;
|
|
||||||
unsigned count, max;
|
|
||||||
iCalPerson *person;
|
|
||||||
NSString *role;
|
|
||||||
|
|
||||||
if (_persons)
|
|
||||||
{
|
|
||||||
list = [self attendees];
|
|
||||||
max = [list count];
|
|
||||||
filtered = [NSMutableArray arrayWithCapacity: max];
|
|
||||||
for (count = 0; count < max; count++)
|
|
||||||
{
|
|
||||||
person = (iCalPerson *) [list objectAtIndex: count];
|
|
||||||
role = [[person role] uppercaseString];
|
|
||||||
if (![role hasPrefix: @"NON-PART"])
|
|
||||||
[filtered addObject: person];
|
|
||||||
}
|
|
||||||
|
|
||||||
list = filtered;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
list = [self childrenWithTag: @"attendee"
|
|
||||||
andAttribute: @"role"
|
|
||||||
havingValue: @"non-part"];
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL) isOrganizer: (id) _email
|
- (BOOL) isOrganizer: (id) _email
|
||||||
{
|
{
|
||||||
NSString *organizerMail;
|
NSString *organizerMail;
|
||||||
|
@ -458,6 +450,35 @@
|
||||||
isEqualToString: [_email lowercaseString]];
|
isEqualToString: [_email lowercaseString]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSArray *) participants
|
||||||
|
{
|
||||||
|
NSArray *list;
|
||||||
|
NSMutableArray *filtered;
|
||||||
|
unsigned count, max;
|
||||||
|
iCalPerson *person;
|
||||||
|
NSString *role;
|
||||||
|
|
||||||
|
list = [self attendees];
|
||||||
|
max = [list count];
|
||||||
|
filtered = [NSMutableArray arrayWithCapacity: max];
|
||||||
|
for (count = 0; count < max; count++)
|
||||||
|
{
|
||||||
|
person = [list objectAtIndex: count];
|
||||||
|
role = [[person role] uppercaseString];
|
||||||
|
if (![role hasPrefix: @"NON-PARTICIPANT"])
|
||||||
|
[filtered addObject: person];
|
||||||
|
}
|
||||||
|
|
||||||
|
return filtered;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSArray *) nonParticipants
|
||||||
|
{
|
||||||
|
return [self childrenWithTag: @"attendee"
|
||||||
|
andAttribute: @"role"
|
||||||
|
havingValue: @"non-participant"];
|
||||||
|
}
|
||||||
|
|
||||||
- (BOOL) isParticipant: (id) _email
|
- (BOOL) isParticipant: (id) _email
|
||||||
{
|
{
|
||||||
NSArray *partEmails;
|
NSArray *partEmails;
|
||||||
|
@ -468,26 +489,6 @@
|
||||||
return [partEmails containsObject:_email];
|
return [partEmails containsObject:_email];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (iCalPerson *) findParticipantWithEmail: (id) _email
|
|
||||||
{
|
|
||||||
NSArray *ps;
|
|
||||||
unsigned i, count;
|
|
||||||
|
|
||||||
_email = [_email lowercaseString];
|
|
||||||
ps = [self participants];
|
|
||||||
count = [ps count];
|
|
||||||
|
|
||||||
for (i = 0; i < count; i++) {
|
|
||||||
iCalPerson *p;
|
|
||||||
|
|
||||||
p = [ps objectAtIndex:i];
|
|
||||||
if ([[[p rfc822Email] lowercaseString] isEqualToString:_email])
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil; /* not found */
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSComparisonResult) _compareValue: (id) selfValue
|
- (NSComparisonResult) _compareValue: (id) selfValue
|
||||||
withValue: (id) otherValue
|
withValue: (id) otherValue
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue