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];