diff --git a/ChangeLog b/ChangeLog index 2f26a9e25..4223bb786 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,10 @@ * SoObjects/SOGo/SQLSource.m (_lookupContactEntry:considerEmail:): make sure the value of column pointer to by _kindField is not nil, nor an NSNull instance before treating it like a string. + Use the value of "_imapHostField", when available, to map the + "c_imaphostname" value of the contact/user record. + (-init): new "_imapHostField" ivar, holder of the value of + IMAPHostFieldName of the source configuration dictionary. 2012-02-21 Wolfgang Sourdeau diff --git a/SoObjects/SOGo/SQLSource.h b/SoObjects/SOGo/SQLSource.h index 0ef15250f..38d35c930 100644 --- a/SoObjects/SOGo/SQLSource.h +++ b/SoObjects/SOGo/SQLSource.h @@ -41,6 +41,7 @@ NSArray *_loginFields; NSArray *_mailFields; NSString *_imapLoginField; + NSString *_imapHostField; NSString *_userPasswordAlgorithm; NSURL *_viewURL; diff --git a/SoObjects/SOGo/SQLSource.m b/SoObjects/SOGo/SQLSource.m index ebdc229c0..ec1801231 100644 --- a/SoObjects/SOGo/SQLSource.m +++ b/SoObjects/SOGo/SQLSource.m @@ -88,6 +88,7 @@ _viewURL = nil; _kindField = nil; _multipleBookingsField = nil; + _imapHostField = nil; } return self; @@ -103,6 +104,7 @@ [_viewURL release]; [_kindField release]; [_multipleBookingsField release]; + [_imapHostField release]; [super dealloc]; } @@ -118,6 +120,7 @@ ASSIGN(_mailFields, [udSource objectForKey: @"MailFieldNames"]); ASSIGN(_userPasswordAlgorithm, [udSource objectForKey: @"userPasswordAlgorithm"]); ASSIGN(_imapLoginField, [udSource objectForKey: @"IMAPLoginFieldName"]); + ASSIGN(_imapHostField, [udSource objectForKey: @"IMAPHostFieldName"]); ASSIGN(_kindField, [udSource objectForKey: @"KindFieldName"]); ASSIGN(_multipleBookingsField, [udSource objectForKey: @"MultipleBookingsFieldName"]); @@ -505,6 +508,12 @@ } [response setObject: emails forKey: @"c_emails"]; + if (_imapHostField) + { + value = [response objectForKey: _imapHostField]; + if ([value isNotNull]) + [response setObject: value forKey: @"c_imaphostname"]; + } // We check if the user can authenticate if (_authenticationFilter)