mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-11-21 23:12:40 +00:00
Monotone-Parent: 8268efeb15753e2949b09378244938f0b6bb08a8
Monotone-Revision: c0c1c6cf72acfbec9c8a2b4e7eeef2f801f49e54 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-09-29T18:31:20 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
1 parent
7d81972309
commit
14993bccb0
12 files changed
+101
-97
No files matched your search
@@ -95,21 +95,14 @@ static NSString *fieldNames[] = {
|
||||
}
|
||||
|
||||
- (NSMutableDictionary *)extractQuickFieldsFromVCardString:(NSString *)_str {
|
||||
NSArray *vCards;
|
||||
NGVCard *vCard;
|
||||
|
||||
if ((vCards = [NGVCard parseVCardsFromSource:_str]) == nil) {
|
||||
[self errorWithFormat:@"Could not parse content as a vCard."];
|
||||
return nil;
|
||||
}
|
||||
if ([vCards count] == 0) {
|
||||
if ((vCard = [NGVCard parseSingleFromSource: _str]) == nil) {
|
||||
[self errorWithFormat:@"Could not parse content as a vCard."];
|
||||
return nil;
|
||||
}
|
||||
|
||||
if ([vCards count] > 1)
|
||||
[self warnWithFormat:@"More than one vCard in content, using first."];
|
||||
|
||||
return [self extractQuickFieldsFromVCard:[vCards objectAtIndex:0]];
|
||||
return [self extractQuickFieldsFromVCard: vCard];
|
||||
}
|
||||
|
||||
- (NSMutableDictionary *)extractQuickFieldsFromContent:(NSString *)_content {
|
||||
|
||||
@@ -208,20 +208,17 @@ static NSNumber *distantFutureNumber = nil;
|
||||
- (NSMutableDictionary *)extractQuickFieldsFromContent:(NSString *)_content {
|
||||
NSAutoreleasePool *pool;
|
||||
NSDictionary *fields;
|
||||
NSArray *cals;
|
||||
id cal;
|
||||
|
||||
if ([_content length] == 0)
|
||||
return nil;
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
cals = [CardGroup groupsOfClass: [iCalCalendar class]
|
||||
fromSource: _content];
|
||||
if ([cals count] > 0)
|
||||
{
|
||||
cal = [cals objectAtIndex: 0];
|
||||
cal = [iCalCalendar parseSingleFromSource: _content];
|
||||
|
||||
fields = nil;
|
||||
fields = nil;
|
||||
if (cal)
|
||||
{
|
||||
if ([cal isKindOfClass:[iCalEvent class]])
|
||||
fields = [[self extractQuickFieldsFromEvent:cal] retain];
|
||||
else if ([cal isKindOfClass:[iCalCalendar class]])
|
||||
@@ -231,6 +228,8 @@ static NSNumber *distantFutureNumber = nil;
|
||||
cal];
|
||||
}
|
||||
}
|
||||
else
|
||||
[self logWithFormat:@"ERROR: parsing source didn't return anything"];
|
||||
|
||||
[pool release];
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
iCalRecurrenceRule *rule;
|
||||
|
||||
rule = [a objectAtIndex:i];
|
||||
[ma addObject:[rule iCalRepresentation]];
|
||||
[ma addObject: [rule versitString]];
|
||||
}
|
||||
[cycleInfo setObject:ma forKey:@"rules"];
|
||||
}
|
||||
@@ -63,7 +63,7 @@
|
||||
iCalRecurrenceRule *rule;
|
||||
|
||||
rule = [a objectAtIndex:i];
|
||||
[ma addObject:[rule iCalRepresentation]];
|
||||
[ma addObject: [rule versitString]];
|
||||
}
|
||||
[cycleInfo setObject:ma forKey:@"exRules"];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user