mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-06 12:30:31 +00:00
Monotone-Parent: f75e6976fca1f78ba386ba4306bd6b4439f1de17
Monotone-Revision: 33c9bbe67c54b7e2a222ee34969604fb76e91600 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-07-16T19:35:25 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSURL.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
|
||||
#import <NGObjWeb/NSException+HTTP.h>
|
||||
@@ -33,6 +34,7 @@
|
||||
#import <NGExtensions/NSNull+misc.h>
|
||||
|
||||
#import <NGCards/NGVCard.h>
|
||||
#import <NGCards/NGVCardPhoto.h>
|
||||
#import <NGCards/NSArray+NGCards.h>
|
||||
|
||||
#import <Contacts/SOGoContactFolder.h>
|
||||
@@ -51,6 +53,7 @@
|
||||
{
|
||||
snapshot = [[NSMutableDictionary alloc] initWithCapacity: 16];
|
||||
preferredEmail = nil;
|
||||
photosURL = nil;
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -60,6 +63,7 @@
|
||||
{
|
||||
[snapshot release];
|
||||
[preferredEmail release];
|
||||
[photosURL release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -573,6 +577,36 @@
|
||||
&& [super canCreateOrModify]);
|
||||
}
|
||||
|
||||
- (NSArray *) photosURL
|
||||
{
|
||||
NSArray *photoElements;
|
||||
NSURL *soURL;
|
||||
NSString *baseInlineURL, *photoURL;
|
||||
NGVCardPhoto *photo;
|
||||
int count, max;
|
||||
|
||||
if (!photosURL)
|
||||
{
|
||||
soURL = [[self clientObject] soURL];
|
||||
baseInlineURL = [soURL absoluteString];
|
||||
photoElements = [card childrenWithTag: @"photo"];
|
||||
max = [photoElements count];
|
||||
photosURL = [[NSMutableArray alloc] initWithCapacity: max];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
photo = [photoElements objectAtIndex: count];
|
||||
if ([photo isInline])
|
||||
photoURL = [NSString stringWithFormat: @"%@/photo%d",
|
||||
baseInlineURL, count];
|
||||
else
|
||||
photoURL = [photo value: 0];
|
||||
[photosURL addObject: photoURL];
|
||||
}
|
||||
}
|
||||
|
||||
return photosURL;
|
||||
}
|
||||
|
||||
- (CardElement *) _elementWithTag: (NSString *) tag
|
||||
ofType: (NSString *) type
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user