mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-11 23:07:12 +00:00
(fix) Improve prevent invitations error handling
This commit is contained in:
1 parent
beb666bc5f
commit
3872af35d1
2 files changed
+17
-6
No files matched your search
@@ -421,11 +421,14 @@
|
|||||||
SOGoUserSettings *us;
|
SOGoUserSettings *us;
|
||||||
NSMutableArray *unavailableAttendees;
|
NSMutableArray *unavailableAttendees;
|
||||||
NSEnumerator *enumerator;
|
NSEnumerator *enumerator;
|
||||||
NSString *currentUID, *ownerUID, *whiteListString;
|
NSString *currentUID, *ownerUID;
|
||||||
NSMutableString *reason;
|
NSMutableString *reason;
|
||||||
NSDictionary *values;
|
NSDictionary *values;
|
||||||
NSMutableDictionary *value, *moduleSettings, *whiteList;
|
NSMutableDictionary *value, *moduleSettings;
|
||||||
|
id whiteList;
|
||||||
|
|
||||||
int i, count;
|
int i, count;
|
||||||
|
|
||||||
i = count = 0;
|
i = count = 0;
|
||||||
|
|
||||||
// Build list of the attendees uids without ressources
|
// Build list of the attendees uids without ressources
|
||||||
@@ -447,8 +450,11 @@
|
|||||||
if (![user isResource] && [[moduleSettings objectForKey:@"PreventInvitations"] boolValue])
|
if (![user isResource] && [[moduleSettings objectForKey:@"PreventInvitations"] boolValue])
|
||||||
{
|
{
|
||||||
// Check if the user have a whiteList
|
// Check if the user have a whiteList
|
||||||
whiteListString = [moduleSettings objectForKey:@"PreventInvitationsWhitelist"];
|
whiteList = [moduleSettings objectForKey:@"PreventInvitationsWhitelist"];
|
||||||
whiteList = [whiteListString objectFromJSONString];
|
|
||||||
|
// 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 the filter have a hit, do not add the currentUID to the unavailableAttendees array
|
||||||
if (![whiteList objectForKey:ownerUID])
|
if (![whiteList objectForKey:ownerUID])
|
||||||
|
|||||||
@@ -660,12 +660,17 @@ static NSArray *reminderValues = nil;
|
|||||||
|
|
||||||
- (void) setWhiteList: (NSString *) whiteListString
|
- (void) setWhiteList: (NSString *) whiteListString
|
||||||
{
|
{
|
||||||
SOGoUserSettings *us;
|
|
||||||
NSMutableDictionary *moduleSettings;
|
NSMutableDictionary *moduleSettings;
|
||||||
|
SOGoUserSettings *us;
|
||||||
|
id o;
|
||||||
|
|
||||||
us = [user userSettings];
|
us = [user userSettings];
|
||||||
moduleSettings = [us objectForKey: @"Calendar"];
|
moduleSettings = [us objectForKey: @"Calendar"];
|
||||||
[moduleSettings setObject: [whiteListString objectFromJSONString] forKey: @"PreventInvitationsWhitelist"];
|
|
||||||
|
if (!(o = [whiteListString objectFromJSONString]))
|
||||||
|
o = [NSDictionary dictionary];
|
||||||
|
|
||||||
|
[moduleSettings setObject: o forKey: @"PreventInvitationsWhitelist"];
|
||||||
[us synchronize];
|
[us synchronize];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user