diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 64baf52d7..4e1371dc8 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -421,11 +421,14 @@ SOGoUserSettings *us; NSMutableArray *unavailableAttendees; NSEnumerator *enumerator; - NSString *currentUID, *ownerUID, *whiteListString; + NSString *currentUID, *ownerUID; NSMutableString *reason; NSDictionary *values; - NSMutableDictionary *value, *moduleSettings, *whiteList; + NSMutableDictionary *value, *moduleSettings; + id whiteList; + int i, count; + i = count = 0; // Build list of the attendees uids without ressources @@ -447,8 +450,11 @@ if (![user isResource] && [[moduleSettings objectForKey:@"PreventInvitations"] boolValue]) { // Check if the user have a whiteList - whiteListString = [moduleSettings objectForKey:@"PreventInvitationsWhitelist"]; - whiteList = [whiteListString objectFromJSONString]; + whiteList = [moduleSettings objectForKey:@"PreventInvitationsWhitelist"]; + + // For backward <= 2.2.17 compatibility + if ([whiteList isKindOfClass: [NSString class]]) + whiteList = [whiteList objectFromJSONString]; // If the filter have a hit, do not add the currentUID to the unavailableAttendees array if (![whiteList objectForKey:ownerUID]) diff --git a/UI/PreferencesUI/UIxPreferences.m b/UI/PreferencesUI/UIxPreferences.m index 9f55e4166..990fda1ed 100644 --- a/UI/PreferencesUI/UIxPreferences.m +++ b/UI/PreferencesUI/UIxPreferences.m @@ -660,12 +660,17 @@ static NSArray *reminderValues = nil; - (void) setWhiteList: (NSString *) whiteListString { - SOGoUserSettings *us; NSMutableDictionary *moduleSettings; + SOGoUserSettings *us; + id o; us = [user userSettings]; moduleSettings = [us objectForKey: @"Calendar"]; - [moduleSettings setObject: [whiteListString objectFromJSONString] forKey: @"PreventInvitationsWhitelist"]; + + if (!(o = [whiteListString objectFromJSONString])) + o = [NSDictionary dictionary]; + + [moduleSettings setObject: o forKey: @"PreventInvitationsWhitelist"]; [us synchronize]; }