parent
510eb97860
commit
a1273f1097
|
@ -289,12 +289,25 @@ static NSString *inboxFolderName = @"INBOX";
|
|||
if (quota != 0 && inboxQuota != nil)
|
||||
{
|
||||
// A soft quota ratio is imposed for all users
|
||||
if ([[inboxQuota allKeys] containsObject: @"maxQuota"])
|
||||
{
|
||||
// Storage quota
|
||||
quota = quota * [(NSNumber*)[inboxQuota objectForKey: @"maxQuota"] intValue];
|
||||
inboxQuota = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithLong: (long)(quota+0.5)], @"maxQuota",
|
||||
[NSNumber numberWithLong: [[inboxQuota objectForKey: @"usedSpace"] longLongValue]], @"usedSpace",
|
||||
nil];
|
||||
}
|
||||
else if ([[inboxQuota allKeys] containsObject: @"maxMessages"])
|
||||
{
|
||||
// Messages quota
|
||||
quota = quota * [(NSNumber*)[inboxQuota objectForKey: @"maxMessages"] intValue];
|
||||
inboxQuota = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithLong: (long)(quota+0.5)], @"maxMessages",
|
||||
[NSNumber numberWithLong: [[inboxQuota objectForKey: @"messagesCount"] longLongValue]], @"messagesCount",
|
||||
nil];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return inboxQuota;
|
||||
|
|
|
@ -319,6 +319,7 @@
|
|||
"Operation failed" = "Operation failed";
|
||||
"Quota" = "Quota:";
|
||||
"quotasFormat" = "%{0}% used on %{1} MB";
|
||||
"messageQuotasFormat" = "%{0}% of %{1} msgs";
|
||||
"Unable to move/delete folder." = "Unable to move/delete folder.";
|
||||
|
||||
/* Alternative operation when folder cannot be deleted */
|
||||
|
|
|
@ -439,9 +439,16 @@
|
|||
Account.prototype.updateQuota = function(data) {
|
||||
var percent, format, description;
|
||||
|
||||
if (data.maxQuota) {
|
||||
percent = (Math.round(data.usedSpace * 10000 / data.maxQuota) / 100);
|
||||
format = l("quotasFormat");
|
||||
description = format.formatted(percent, Math.round(data.maxQuota/10.24)/100);
|
||||
}
|
||||
else if (data.maxMessages) {
|
||||
percent = (Math.round(data.messagesCount * 10000 / data.maxMessages) / 100);
|
||||
format = l("messageQuotasFormat");
|
||||
description = format.formatted(percent, data.maxMessages);
|
||||
}
|
||||
|
||||
this.$quota = { percent: percent, description: description };
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue