mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-09-17 19:38:00 +00:00
@@ -1,6 +1,6 @@
|
||||
/* NGVCard+SOGo.h - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2009-2015 Inverse inc.
|
||||
* Copyright (C) 2009-2016 Inverse inc.
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -49,6 +49,9 @@
|
||||
- (NSString *) pager;
|
||||
- (NSCalendarDate *) birthday;
|
||||
|
||||
- (void) setNotes: (NSArray *) newNotes;
|
||||
- (NSArray *) notes;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* NGVCARD_SOGO_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* NGVCard+SOGo.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2009-2015 Inverse inc.
|
||||
* Copyright (C) 2009-2016 Inverse inc.
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -339,7 +339,11 @@ convention:
|
||||
setSingleValue: [ldifRecord objectForKey: @"c_info"]
|
||||
forKey: @""];
|
||||
|
||||
[self setNote: [ldifRecord objectForKey: @"description"]];
|
||||
o = [ldifRecord objectForKey: @"description"];
|
||||
if ([o isKindOfClass: [NSArray class]])
|
||||
[self setNotes: o];
|
||||
else
|
||||
[self setNote: o];
|
||||
|
||||
o = [ldifRecord objectForKey: @"vcardcategories"];
|
||||
|
||||
@@ -851,6 +855,40 @@ convention:
|
||||
return date;
|
||||
}
|
||||
|
||||
- (void) setNotes: (NSArray *) newNotes
|
||||
{
|
||||
NSUInteger count, max;
|
||||
|
||||
max = [newNotes count];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
[self addChildWithTag: @"note"
|
||||
types: nil
|
||||
singleValue: [newNotes objectAtIndex: count]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (NSArray *) notes
|
||||
{
|
||||
NSArray *notes;
|
||||
NSMutableArray *flattenedNotes;
|
||||
NSString *note;
|
||||
NSUInteger count, max;
|
||||
|
||||
notes = [self childrenWithTag: @"note"];
|
||||
max = [notes count];
|
||||
flattenedNotes = [NSMutableArray arrayWithCapacity: max];
|
||||
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
note = [[notes objectAtIndex: count] flattenedValuesForKey: @""];
|
||||
[flattenedNotes addObject: note];
|
||||
}
|
||||
|
||||
return flattenedNotes;
|
||||
}
|
||||
|
||||
- (NSMutableDictionary *) quickRecordFromContent: (NSString *) theContent
|
||||
container: (id) theContainer
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user