fix(mail): check return value of "setacl" IMAP command

This commit is contained in:
Francis Lachapelle
2022-03-09 14:57:32 -05:00
parent 1545bcdbba
commit 55baeb107f

View File

@@ -1647,13 +1647,24 @@ static NSInteger _compareFetchResultsByUID (id entry1, id entry2, NSArray *uids)
forUser: (NSString *) uid
{
NSString *acls, *folderName;
NSDictionary *result;
acls = [self _sogoACLsToIMAPACLs: roles];
folderName = [[self imap4Connection] imap4FolderNameForURL: [self imap4URL]];
[[imap4 client] setACL: folderName rights: acls uid: [self _sogoACLUIDToIMAPUID: uid]];
result = [[imap4 client] setACL: folderName rights: acls uid: [self _sogoACLUIDToIMAPUID: uid]];
[mailboxACL release];
mailboxACL = nil;
if (![[result valueForKey: @"result"] boolValue])
{
NSException *error;
error = [NSException exceptionWithName: @"SOGoMailException"
reason: @"Error while setting roles"
userInfo: (id)result];
[error raise];
}
}
- (NSString *) defaultUserID