Skip to content

Commit

Permalink
fix(mail): check return value of "setacl" IMAP command
Browse files Browse the repository at this point in the history
  • Loading branch information
cgx committed Mar 9, 2022
1 parent 1545bcd commit 55baeb1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion SoObjects/Mailer/SOGoMailFolder.m
Expand Up @@ -1647,13 +1647,24 @@ - (void) setRoles: (NSArray *) roles
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
Expand Down

0 comments on commit 55baeb1

Please sign in to comment.