From da111aa6cc902c98545021250d0c359dbf5899bb Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 14 Feb 2012 21:23:31 +0000 Subject: [PATCH] Monotone-Parent: bdd1da1e1be522e483da3257b19a669856f518d6 Monotone-Revision: c5233a2a4e6a6abdb50191daf1eb589c9ff5cf80 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-02-14T21:23:31 --- ChangeLog | 8 ++++++++ SoObjects/SOGo/SOGoUserManager.m | 5 ++++- SoObjects/SOGo/SQLSource.m | 9 ++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d8698c482..63dbacc06 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,14 @@ 2012-02-14 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoUserManager.m (_compactAndCompleteContacts:): + we make sure that "source" is not nil before assigning it to the + compact record. + + * SoObjects/SOGo/SQLSource.m (_lookupContactEntry:considerEmail:): + assign self as value for "source" in the returned record. + (-fetchContactsMatching): same as above. + * SoObjects/SOGo/SOGoSQLUserProfile.m (_sqlJsonRepresentation:): removed obsolete method. (-storeJSONProfileInDB:): we now properly escape the stored value diff --git a/SoObjects/SOGo/SOGoUserManager.m b/SoObjects/SOGo/SOGoUserManager.m index 91915716a..456ed2893 100644 --- a/SoObjects/SOGo/SOGoUserManager.m +++ b/SoObjects/SOGo/SOGoUserManager.m @@ -817,6 +817,7 @@ NSMutableArray *emails; NSString *uid, *email, *info; NSNumber *isGroup; + id source; compactContacts = [NSMutableDictionary dictionary]; while ((userEntry = [contacts nextObject])) @@ -829,7 +830,9 @@ { returnContact = [NSMutableDictionary dictionary]; [returnContact setObject: uid forKey: @"c_uid"]; - [returnContact setObject: [userEntry objectForKey: @"source"] forKey: @"source"]; + source = [userEntry objectForKey: @"source"]; + if (source) + [returnContact setObject: source forKey: @"source"]; [compactContacts setObject: returnContact forKey: uid]; } if (![[returnContact objectForKey: @"c_name"] length]) diff --git a/SoObjects/SOGo/SQLSource.m b/SoObjects/SOGo/SQLSource.m index 84777c8ab..6348d9654 100644 --- a/SoObjects/SOGo/SQLSource.m +++ b/SoObjects/SOGo/SQLSource.m @@ -560,6 +560,8 @@ forKey: @"numberOfSimultaneousBookings"]; } } + + [response setObject: self forKey: @"source"]; } else [self errorWithFormat: @"could not run SQL '%@': %@", sql, ex]; @@ -666,7 +668,12 @@ attrs = [channel describeResults: NO]; while ((row = [channel fetchAttributes: attrs withZone: NULL])) - [results addObject: row]; + { + row = [row mutableCopy]; + [(NSMutableDictionary *) row setObject: self forKey: @"source"]; + [results addObject: row]; + [row release]; + } } else [self errorWithFormat: @"could not run SQL '%@': %@", sql, ex];