mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-25 12:18:54 +00:00
Monotone-Parent: fa7f4f3829eb5576b8845dcb4c03e5327cc7e354
Monotone-Revision: bed152d621c11e6d16b59bdf26007079a05e1696 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-09-22T21:11:08 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
1 parent
3ef9f1cef1
commit
fcc5d28eca
4 files changed
+33
-1
No files matched your search
@@ -12,6 +12,16 @@
|
|||||||
|
|
||||||
2009-09-22 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2009-09-22 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* SoObjects/Mailer/SOGoMailObject.m (-fetchPlainTextParts:):
|
||||||
|
handle the fact that the "fetch" key in a RawResponse (NGHashMap)
|
||||||
|
may not be the only response. Since [NGHashMap objectForKey:]
|
||||||
|
returns only the first one, we use the new "flattenedDictionaries"
|
||||||
|
to make sure we can retrieve all requested keys.
|
||||||
|
|
||||||
|
* SoObjects/SOGo/NSArray+Utilities.m (-flattenedDictionaries): new
|
||||||
|
method that merges the keys and values of all contained
|
||||||
|
dictionaries into one single dictionary.
|
||||||
|
|
||||||
* Tests/webdavlib.py (_WD_XMLTreeElement.__init__): added a new
|
* Tests/webdavlib.py (_WD_XMLTreeElement.__init__): added a new
|
||||||
optional parameter "attributes" that enables the setting of
|
optional parameter "attributes" that enables the setting of
|
||||||
element attributes during the rendering of the element.
|
element attributes during the rendering of the element.
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#import <NGObjWeb/WOContext+SoObjects.h>
|
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||||
#import <NGObjWeb/WOResponse.h>
|
#import <NGObjWeb/WOResponse.h>
|
||||||
#import <NGObjWeb/NSException+HTTP.h>
|
#import <NGObjWeb/NSException+HTTP.h>
|
||||||
|
#import <NGExtensions/NGHashMap.h>
|
||||||
#import <NGExtensions/NSNull+misc.h>
|
#import <NGExtensions/NSNull+misc.h>
|
||||||
#import <NGExtensions/NSObject+Logs.h>
|
#import <NGExtensions/NSObject+Logs.h>
|
||||||
#import <NGExtensions/NSString+Encoding.h>
|
#import <NGExtensions/NSString+Encoding.h>
|
||||||
@@ -613,6 +614,7 @@ static BOOL debugSoParts = NO;
|
|||||||
// TODO: is the name correct or does it also fetch other parts?
|
// TODO: is the name correct or does it also fetch other parts?
|
||||||
NSMutableDictionary *flatContents;
|
NSMutableDictionary *flatContents;
|
||||||
unsigned i, count;
|
unsigned i, count;
|
||||||
|
NSArray *results;
|
||||||
id result;
|
id result;
|
||||||
|
|
||||||
[self debugWithFormat: @"fetch keys: %@", _fetchKeys];
|
[self debugWithFormat: @"fetch keys: %@", _fetchKeys];
|
||||||
@@ -622,7 +624,8 @@ static BOOL debugSoParts = NO;
|
|||||||
result = [result valueForKey: @"RawResponse"]; // hackish
|
result = [result valueForKey: @"RawResponse"]; // hackish
|
||||||
|
|
||||||
// Note: -valueForKey: doesn't work!
|
// Note: -valueForKey: doesn't work!
|
||||||
result = [(NSDictionary *)result objectForKey: @"fetch"];
|
results = [(NGHashMap *)result objectsForKey: @"fetch"];
|
||||||
|
result = [results flattenedDictionaries];
|
||||||
|
|
||||||
count = [_fetchKeys count];
|
count = [_fetchKeys count];
|
||||||
flatContents = [NSMutableDictionary dictionaryWithCapacity:count];
|
flatContents = [NSMutableDictionary dictionaryWithCapacity:count];
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
- (NSArray *) objectsForKey: (NSString *) key
|
- (NSArray *) objectsForKey: (NSString *) key
|
||||||
notFoundMarker: (id) marker;
|
notFoundMarker: (id) marker;
|
||||||
- (NSArray *) flattenedArray;
|
- (NSArray *) flattenedArray;
|
||||||
|
- (NSDictionary *) flattenedDictionaries;
|
||||||
|
|
||||||
- (NSArray *) uniqueObjects;
|
- (NSArray *) uniqueObjects;
|
||||||
|
|
||||||
|
|||||||
@@ -121,6 +121,24 @@
|
|||||||
return flattenedArray;
|
return flattenedArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSDictionary *) flattenedDictionaries
|
||||||
|
{
|
||||||
|
NSMutableDictionary *newDict;
|
||||||
|
NSDictionary *currentDictionary;
|
||||||
|
int count, max;
|
||||||
|
|
||||||
|
newDict = [NSMutableDictionary dictionary];
|
||||||
|
|
||||||
|
max = [self count];
|
||||||
|
for (count = 0; count < max; count++)
|
||||||
|
{
|
||||||
|
currentDictionary = [self objectAtIndex: count];
|
||||||
|
[newDict addEntriesFromDictionary: currentDictionary];
|
||||||
|
}
|
||||||
|
|
||||||
|
return newDict;
|
||||||
|
}
|
||||||
|
|
||||||
- (NSArray *) uniqueObjects
|
- (NSArray *) uniqueObjects
|
||||||
{
|
{
|
||||||
NSMutableArray *newArray;
|
NSMutableArray *newArray;
|
||||||
|
|||||||
Reference in new issue
Block a user