See ChangeLog

Monotone-Parent: a4f6c377a41454eb21ed5b253cb7d07fc2c1a55e
Monotone-Revision: 3c7106a946b0d9786d46c4f0c0a7e5bc1e5f8684

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2011-12-29T17:50:48
This commit is contained in:
Ludovic Marcotte
2011-12-29 17:50:48 +00:00
parent 5799804274
commit 516dcdb255
9 changed files with 74 additions and 18 deletions

View File

@@ -4,6 +4,14 @@
don't escape the / character as it's generating invalid JSON
output on newer versions of PostgreSQL.
* Dropped all references to "SOGoMailCheckAllUnseenCounts". We
now check all folders for which filters are defined with a
"fileinto" action - even if they are disable.
* UI/MailerUI/UIxMailAccountActions.m (_jsonFolders:) - we
use a local autorelease pool in the tight loop to avoid consuming
too many LDAP connections during its execution.
2011-12-23 Francis Lachapelle <flachapelle@inverse.ca>
* UI/Scheduler/UIxAppointmentEditor.m (-viewAction): the end

2
NEWS
View File

@@ -2,6 +2,8 @@
---------------------
New Features
- show end time in bubble box of events
- we now check for new mails in folders for which
sieve rules are defined to file messages into
Enhancements
- updated Ukrainian translation

View File

@@ -64,7 +64,6 @@
- (NSArray *) calendarDefaultRoles;
- (NSArray *) contactsDefaultRoles;
- (NSArray *) mailPollingIntervals;
- (BOOL) mailCheckAllUnseenCounts;
- (NSString *) calendarDefaultCategoryColor;

View File

@@ -208,11 +208,6 @@
return [self arrayForKey: @"SOGoMailPollingIntervals"];
}
- (BOOL) mailCheckAllUnseenCounts
{
return [self boolForKey: @"SOGoMailCheckAllUnseenCounts"];
}
- (NSString *) smtpServer
{
return [self stringForKey: @"SOGoSMTPServer"];

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2007-2011 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Ludovic Marcotte <lmarcotte@inverse.ca>
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,6 +22,7 @@
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSEnumerator.h>
#import <Foundation/NSValue.h>
@@ -122,10 +124,16 @@
SOGoUserManager *userManager;
NSDictionary *folderData;
NSMutableArray *folders;
NSAutoreleasePool *pool;
folders = [NSMutableArray array];
while ((currentFolder = [rawFolders nextObject]))
{
// Using a local pool to avoid using too many file descriptors. This could
// happen with tons of mailboxes under "Other Users" as LDAP connections
// are never reused and "autoreleased" at the end. This loop would consume
// lots of LDAP connections during its execution.
pool = [[NSAutoreleasePool alloc] init];
currentFolderType = [self _folderType: currentFolder];
// We translate the "Other Users" and "Shared Folders" namespaces.
@@ -169,6 +177,7 @@
currentDisplayName, @"displayName",
nil];
[folders addObject: folderData];
[pool release];
}
return folders;

View File

@@ -1,6 +1,6 @@
/* UIxMailMainFrame.h - this file is part of SOGo
*
* Copyright (C) 2006 Inverse inc.
* Copyright (C) 2006-2011 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*

View File

@@ -2,6 +2,9 @@
Copyright (C) 2007-2011 Inverse inc.
Copyright (C) 2004-2005 SKYRIX Software AG
Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
Ludovic Marcotte <lmarcotte@inverse.ca>
This file is part of SOGo.
SOGo is free software; you can redistribute it and/or modify it under
@@ -626,14 +629,55 @@
return [self labelForKey: [currentColumn objectForKey: @"value"]];
}
- (NSString *) getUnseenCountForAllFolders
- (NSString *) unseenCountFolders
{
SOGoDomainDefaults *dd;
NSArray *pathComponents, *filters, *actions;
NSDictionary *d, *action;
NSMutableArray *folders;
NSMutableString *path;
SOGoUserDefaults *ud;
NSString *s;
int i, j, k;
dd = [[context activeUser] domainDefaults];
ud = [[context activeUser] userDefaults];
folders = [NSMutableArray array];
return ([dd mailCheckAllUnseenCounts] ? @"true" : @"false");
filters = [ud sieveFilters];
for (i = 0; i < [filters count]; i++)
{
d = [filters objectAtIndex: i];
actions = [d objectForKey: @"actions"];
for (j = 0; j < [actions count]; j++)
{
action = [actions objectAtIndex: j];
if ([[action objectForKey: @"method"] caseInsensitiveCompare: @"fileinto"] == NSOrderedSame)
{
s = [action objectForKey: @"argument"];
// We format the result string so that MailerUI.js can simply consume that information
// without doing anything special on its side
if (s)
{
pathComponents = [s componentsSeparatedByString: @"/"];
path = [NSMutableString string];
for (k = 0; k < [pathComponents count]; k++)
{
[path appendFormat: @"folder%@", [[pathComponents objectAtIndex: k] asCSSIdentifier]];
if (k < [pathComponents count] - 1)
[path appendString: @"/"];
}
[folders addObject: [NSString stringWithFormat: @"/0/%@", path]];
}
}
}
}
return [folders jsonRepresentation];
}
@end /* UIxMailMainFrame */

View File

@@ -13,7 +13,7 @@
<script type="text/javascript">
var mailAccounts = <var:string value="mailAccounts" const:escapeHTML="NO"/>;
var inboxData = <var:string value="inboxData" const:escapeHTML="NO"/>;
var getUnseenCountForAllFolders = <var:string value="getUnseenCountForAllFolders"/>;
var unseenCountFolders = <var:string value="unseenCountFolders" const:escapeHTML="NO"/>;
</script>
<style type="text/css">
<var:if condition="horizontalDragHandleStyle">

View File

@@ -855,7 +855,7 @@ function openMailbox(mailbox, reload) {
Mailer.currentMailbox = mailbox;
if (!getUnseenCountForAllFolders && Mailer.unseenCountMailboxes.indexOf(mailbox) == -1) {
if (Mailer.unseenCountMailboxes.indexOf(mailbox) == -1) {
Mailer.unseenCountMailboxes.push(mailbox);
}
@@ -2048,10 +2048,9 @@ function initMailboxTreeCB() {
checkAjaxRequestsState();
getFoldersState();
configureDroppables();
if (getUnseenCountForAllFolders) {
for (var i = 0; i < mailboxTree.aNodes.length; i++) {
var mailboxPath = mailboxTree.aNodes[i].dataname;
Mailer.unseenCountMailboxes.push(mailboxPath);
if (unseenCountFolders.length > 0) {
for (var i = 0; i < unseenCountFolders.length; i++) {
Mailer.unseenCountMailboxes.push(unseenCountFolders[i]);
}
refreshUnseenCounts();
}