Monotone-Parent: dcceb57e8e6ee4fbdfba1d9ff1f44cb1c59b56f5

Monotone-Revision: b9fb860f8f7838df1fa7d5d3aa5503299b0ca08a

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-09-02T04:02:46
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2008-09-02 04:02:46 +00:00
parent 5f355f5777
commit 8a2f70f210
2 changed files with 20 additions and 5 deletions

View File

@ -1,3 +1,11 @@
2008-09-02 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Mailer/SOGoMailManager.m ([NGImap
-copyMailURL:toFolderURL:password:]): do not compare the urls
based on the instance that NGImap4ConnectionManager returns,
because disabling the pooling will generate a bad result, even
though the host:port pairs are the same.
2008-09-01 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/MailerUI/UIxMailView.m ([UIxMailView

View File

@ -20,6 +20,8 @@
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSURL.h>
#import <Foundation/NSValue.h>
#import <NGObjWeb/NSException+HTTP.h>
#import <NGExtensions/NSNull+misc.h>
@ -194,20 +196,25 @@
password:(NSString *)_pwd
{
NGImap4Connection *entry;
NSNumber *destPort, *srcPort;
/* check connection cache */
if ((entry = [self connectionForURL:_srcurl password:_pwd]) == nil)
return [self errorForMissingEntryAtURL:_srcurl];
/* check whether URLs are on different servers */
if ([self connectionForURL:_desturl password:_pwd] != entry) {
srcPort = [_srcurl port];
destPort = [_desturl port];
if (!([[_desturl host] isEqualToString: [_srcurl host]]
&& (srcPort == destPort
|| [destPort isEqualToNumber: srcPort]))) {
// TODO: find a better error code
return [NSException exceptionWithHTTPStatus:502 /* Bad Gateway */
reason:@"source and destination on different servers"];
}
}
return [entry copyMailURL:_srcurl toFolderURL:_desturl];
}