mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-05 08:34:30 +00:00
Monotone-Parent: aca60c9c05d1955d2a8eb227d271264dd42c7a40
Monotone-Revision: c6371fd55a8f742237747596cbfcb5ecb1e70bcc Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-03-07T21:11:13 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
+43
-40
@@ -96,49 +96,52 @@ static BOOL shouldDisplayWeekend = NO;
|
||||
- (NSArray *) filterAppointments:(NSArray *) _apts
|
||||
{
|
||||
NSMutableArray *filtered;
|
||||
unsigned i, count;
|
||||
NSString *email;
|
||||
unsigned i, count;
|
||||
NSString *email;
|
||||
NSDictionary *info;
|
||||
NSArray *partmails;
|
||||
unsigned p, pCount;
|
||||
BOOL shouldAdd;
|
||||
NSString *partmailsString;
|
||||
NSArray *partstates;
|
||||
NSString *state;
|
||||
NSString *pEmail;
|
||||
|
||||
count = [_apts count];
|
||||
if (!count) return _apts;
|
||||
if ([self shouldDisplayRejectedAppointments]) return _apts;
|
||||
if ([self shouldDisplayRejectedAppointments])
|
||||
return _apts;
|
||||
{
|
||||
count = [_apts count];
|
||||
filtered = [[[NSMutableArray alloc] initWithCapacity: count] autorelease];
|
||||
email = [self emailForUser];
|
||||
|
||||
filtered = [[[NSMutableArray alloc] initWithCapacity: count] autorelease];
|
||||
email = [self emailForUser];
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
shouldAdd = YES;
|
||||
info = [_apts objectAtIndex: i];
|
||||
partmailsString = [info objectForKey: @"partmails"];
|
||||
if ([partmailsString isNotNull])
|
||||
{
|
||||
partmails = [partmailsString componentsSeparatedByString: @"\n"];
|
||||
pCount = [partmails count];
|
||||
for (p = 0; p < pCount; p++)
|
||||
{
|
||||
pEmail = [partmails objectAtIndex: p];
|
||||
if ([pEmail isEqualToString: email])
|
||||
{
|
||||
partstates = [[info objectForKey: @"partstates"]
|
||||
componentsSeparatedByString: @"\n"];
|
||||
state = [partstates objectAtIndex: p];
|
||||
if ([state intValue] == iCalPersonPartStatDeclined)
|
||||
shouldAdd = NO;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (shouldAdd)
|
||||
[filtered addObject: info];
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
NSDictionary *info;
|
||||
NSArray *partmails;
|
||||
unsigned p, pCount;
|
||||
BOOL shouldAdd;
|
||||
|
||||
shouldAdd = YES;
|
||||
info = [_apts objectAtIndex: i];
|
||||
partmails = [[info objectForKey: @"partmails"]
|
||||
componentsSeparatedByString: @"\n"];
|
||||
pCount = [partmails count];
|
||||
for (p = 0; p < pCount; p++)
|
||||
{
|
||||
NSString *pEmail;
|
||||
|
||||
pEmail = [partmails objectAtIndex: p];
|
||||
if ([pEmail isEqualToString: email])
|
||||
{
|
||||
NSArray *partstates;
|
||||
NSString *state;
|
||||
|
||||
partstates = [[info objectForKey: @"partstates"]
|
||||
componentsSeparatedByString: @"\n"];
|
||||
state = [partstates objectAtIndex: p];
|
||||
if ([state intValue] == iCalPersonPartStatDeclined)
|
||||
shouldAdd = NO;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (shouldAdd)
|
||||
[filtered addObject: info];
|
||||
}
|
||||
return filtered;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user