diff --git a/UI/PreferencesUI/UIxJSONPreferences.m b/UI/PreferencesUI/UIxJSONPreferences.m index f33797ca2..610a712f1 100644 --- a/UI/PreferencesUI/UIxJSONPreferences.m +++ b/UI/PreferencesUI/UIxJSONPreferences.m @@ -25,6 +25,7 @@ #import #import +#import #import #import #import @@ -136,9 +137,21 @@ - (WOResponse *) jsonSettingsAction { SOGoUserSettings *settings; + id v; settings = [[context activeUser] userSettings]; + // We sanitize PreventInvitationsWhitelist if we need to, this is due to the fact + // that SOGo <= 2.2.17 used to store it as a JSON *string* within the JSON-blob - + // sorry about this engineering brain fart! + v = [[settings objectForKey: @"Calendar"] objectForKey: @"PreventInvitationsWhitelist"]; + + if (v && [v isKindOfClass: [NSString class]]) + { + [[settings objectForKey: @"Calendar"] setObject: [v objectFromJSONString] + forKey: @"PreventInvitationsWhitelist"]; + } + return [self _makeResponse: [[settings source] values]]; }