See ChangeLog

Monotone-Parent: e0268121f41f4a9ac6226ffcf9e54efb36a9d2d3
Monotone-Revision: 5ca46341daec14901e918e991004a22b7ada9f49

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2008-09-28T14:02:40
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Ludovic Marcotte
2008-09-28 14:02:40 +00:00
parent 7693e9df82
commit 26e2ab38de
15 changed files with 700 additions and 340 deletions
+52 -3
View File
@@ -27,6 +27,7 @@
*/
#import <Foundation/NSCalendarDate.h>
#import <Foundation/NSCharacterSet.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSEnumerator.h>
#import <Foundation/NSTimeZone.h>
@@ -104,6 +105,55 @@
return [dateFormatter formattedDateAndTime: messageDate];
}
//
// Priorities are defined like this:
//
// X-Priority: 1 (Highest)
// X-Priority: 2 (High)
// X-Priority: 3 (Normal)
// X-Priority: 4 (Low)
// X-Priority: 5 (Lowest)
//
// Sometimes, the MUAs don't send over the string in () so we ignore it.
//
- (NSString *) messagePriority
{
NSString *result;
NSData *data;
data = [message objectForKey: @"header"];
result = @"";
if (data)
{
NSString *s;
s = [[NSString alloc] initWithData: data
encoding: NSASCIIStringEncoding];
if (s)
{
NSRange r;
[s autorelease];
r = [s rangeOfString: @":"];
if (r.length)
{
s = [[s substringFromIndex: r.location+1]
stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]];
if ([s hasPrefix: @"1"]) result = [self labelForKey: @"highest"];
else if ([s hasPrefix: @"2"]) result = [self labelForKey: @"high"];
else if ([s hasPrefix: @"4"]) result = [self labelForKey: @"low"];
else if ([s hasPrefix: @"5"]) result = [self labelForKey: @"lowest"];
}
}
}
return result;
}
- (NSString *) messageSubject
{
id baseSubject;
@@ -239,9 +289,8 @@
if (!keys)
keys = [[NSArray alloc] initWithObjects: @"UID",
@"FLAGS", @"ENVELOPE", @"RFC822.SIZE",
@"BODYSTRUCTURE", nil];
@"FLAGS", @"ENVELOPE", @"RFC822.SIZE",
@"BODYSTRUCTURE", @"BODY[HEADER.FIELDS (X-PRIORITY)]", nil];
return keys;
}