mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-05 16:35:10 +00:00
See ChangeLog
Monotone-Parent: 878b0a3e701f87665e2ba4cf8ce540e2a8249c27 Monotone-Revision: 77d1441139223ab426bd10fee87d648b0711aeff Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2009-02-17T23:45:58 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
|
||||
2009-02-17 Francis Lachapelle <flachapelle@inverse.ca>
|
||||
|
||||
* UI/MailerUI/UIxMailListView.m ([UIxMailListView -messages]):
|
||||
forced ordering of messages based on sorted UIDs.
|
||||
|
||||
* UI/Contacts/UIxContactFoldersView.m ([UIxContactFoldersView
|
||||
-allContactSearchAction]): replaced references to "displayName" by
|
||||
"c_cn", following changes made on 2009-02-06.
|
||||
|
||||
@@ -460,9 +460,11 @@
|
||||
- (NSArray *) messages
|
||||
{
|
||||
NSArray *uids;
|
||||
NSDictionary *msgs;
|
||||
NSDictionary *msgs, *msg;
|
||||
NSEnumerator *msgsList;
|
||||
NSMutableArray *unsortedMsgs, *sortedMsgs;
|
||||
NSRange r;
|
||||
unsigned len;
|
||||
unsigned len, index;
|
||||
|
||||
if (!messages)
|
||||
{
|
||||
@@ -470,12 +472,26 @@
|
||||
uids = [self sortedUIDs];
|
||||
len = [uids count];
|
||||
if (len > r.length)
|
||||
/* only need to restrict if we have a lot */
|
||||
uids = [uids subarrayWithRange: r];
|
||||
|
||||
/* only need to restrict if we have a lot */
|
||||
uids = [uids subarrayWithRange: r];
|
||||
|
||||
// Don't assume the IMAP server return the messages in the
|
||||
// same order as the specified list of UIDs (specially true for
|
||||
// dovecot).
|
||||
msgs = (NSDictionary *) [[self clientObject] fetchUIDs: uids
|
||||
parts: [self fetchKeys]];
|
||||
messages = [[msgs objectForKey: @"fetch"] retain];
|
||||
unsortedMsgs = [msgs objectForKey: @"fetch"];
|
||||
sortedMsgs = [NSMutableArray arrayWithCapacity: [unsortedMsgs count]];
|
||||
msgsList = [unsortedMsgs objectEnumerator];
|
||||
while ( (msg = [msgsList nextObject]) )
|
||||
{
|
||||
index = [uids indexOfObject: [msg objectForKey: @"uid"]];
|
||||
if (index < [sortedMsgs count])
|
||||
[sortedMsgs insertObject: msg atIndex: index];
|
||||
else
|
||||
[sortedMsgs addObject: msg];
|
||||
}
|
||||
messages = [[NSArray arrayWithArray: sortedMsgs] retain];
|
||||
}
|
||||
|
||||
return messages;
|
||||
|
||||
Reference in New Issue
Block a user