See ChangeLog

Monotone-Parent: d5f9ac8f8c26df4ffbd173e66fb8557ec6e21545
Monotone-Revision: dc272097703f10ee6c465fdca0d4d40682d7ce55

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2011-03-17T21:26:51
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2011-03-17 21:26:51 +00:00
parent adefb89d55
commit 8cebdc7033
7 changed files with 114 additions and 69 deletions
+2 -1
View File
@@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2010 Inverse inc.
Copyright (C) 2009-2011 Inverse inc.
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of SOGo.
@@ -63,6 +63,7 @@ typedef enum {
- (BOOL) imapAclConformsToIMAPExt;
- (BOOL) supportsQuotas;
- (id) getInboxQuota;
- (BOOL) updateFilters;
- (NSArray *) identities;
+34 -1
View File
@@ -1,6 +1,6 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
Copyright (C) 2007-2009 Inverse inc.
Copyright (C) 2007-2011 Inverse inc.
This file is part of SOGo.
@@ -227,6 +227,39 @@ static NSString *sieveScriptName = @"sogo";
return [capability containsObject: @"quota"];
}
- (id) getInboxQuota
{
SOGoMailFolder *inbox;
NGImap4Client *client;
NSString *inboxName;
SOGoDomainDefaults *dd;
id inboxQuota, infos;
float quota;
inboxQuota = nil;
if ([self supportsQuotas])
{
dd = [[context activeUser] domainDefaults];
quota = [dd softQuotaRatio];
inbox = [self inboxFolderInContext: context];
inboxName = [NSString stringWithFormat: @"/%@", [inbox relativeImap4Name]];
client = [[inbox imap4Connection] client];
infos = [[client getQuotaRoot: [inbox relativeImap4Name]] objectForKey: @"quotas"];
inboxQuota = [infos objectForKey: inboxName];
if (quota != 0 && inboxQuota != nil)
{
// A soft quota ratio is imposed for all users
quota = quota * [(NSNumber*)[inboxQuota objectForKey: @"maxQuota"] intValue];
inboxQuota = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithLong: (long)(quota+0.5)], @"maxQuota",
[inboxQuota objectForKey: @"usedSpace"], @"usedSpace",
nil];
}
}
return inboxQuota;
}
- (BOOL) updateFilters
{
NSMutableArray *requirements;