MailDAV Fixes

Monotone-Parent: 43ac2f2aa838034f00194247d4c245926ed738de
Monotone-Revision: a133bab8f4c9ee8ea78123618542c4a2ecdc2fd4

Monotone-Author: crobert@inverse.ca
Monotone-Date: 2009-10-01T21:55:29
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
C Robert 2009-10-01 21:55:29 +00:00
parent f1ffcac389
commit a72a55de90
3 changed files with 6 additions and 8 deletions

View file

@ -95,7 +95,6 @@ typedef enum {
- (BOOL) ensureSpoolFolderPath;
- (id) appendMessage: (NSData *) message
inContext: (WOContext *) _ctx
usingId: (int *) imap4id;
@end

View file

@ -1119,7 +1119,8 @@ static NSString *spoolFolder = nil;
if ([[result objectForKey: @"result"] boolValue])
{
*imap4id = [self IMAP4IDFromAppendResult: result];
if (imap4id)
*imap4id = [self IMAP4IDFromAppendResult: result];
[client unselect];
}
else
@ -1130,7 +1131,6 @@ static NSString *spoolFolder = nil;
}
- (id) appendMessage: (NSData *) message
inContext: (WOContext *) _ctx
usingId: (int *) imap4id
{
NSException *error;
@ -1143,7 +1143,7 @@ static NSString *spoolFolder = nil;
response = (WOResponse *) error;
else
{
response = [_ctx response];
response = [context response];
[response setStatus: 201];
location = [NSString stringWithFormat: @"%@%d.eml",
[self davURL], *imap4id];
@ -1167,7 +1167,6 @@ static NSString *spoolFolder = nil;
{
rq = [_ctx request];
response = [self appendMessage: [rq content]
inContext: _ctx
usingId: &imap4id];
}

View file

@ -1262,7 +1262,6 @@ static BOOL debugSoParts = NO;
reason: @"Can't overwrite messages"];
else
response = [folder appendMessage: [rq content]
inContext: _ctx
usingId: &imap4id];
}
@ -1310,7 +1309,6 @@ static BOOL debugSoParts = NO;
- (NSString *) _emailAddressesFrom: (NSArray *) enveloppeAddresses
{
//voir spec
NSMutableArray *addresses;
NSString *rc;
NGImap4EnvelopeAddress *address;
@ -1404,7 +1402,9 @@ static BOOL debugSoParts = NO;
range = [value rangeOfString: @"received:"
options: NSCaseInsensitiveSearch
range: NSMakeRange (10, [value length]-11)];
if (range.length)
if (range.length
&& range.location < [value length]
&& range.length < [value length])
{
// We want to keep the first part
range.length = range.location;