From 8a2f70f210b6f6a82eea881a83b16b7fe577c36b Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 2 Sep 2008 04:02:46 +0000 Subject: [PATCH] Monotone-Parent: dcceb57e8e6ee4fbdfba1d9ff1f44cb1c59b56f5 Monotone-Revision: b9fb860f8f7838df1fa7d5d3aa5503299b0ca08a Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-09-02T04:02:46 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 8 ++++++++ SoObjects/Mailer/SOGoMailManager.m | 17 ++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8a101a8ae..7258ed874 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-09-02 Wolfgang Sourdeau + + * 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 * UI/MailerUI/UIxMailView.m ([UIxMailView diff --git a/SoObjects/Mailer/SOGoMailManager.m b/SoObjects/Mailer/SOGoMailManager.m index 59c1f4c0b..b9b42e23f 100644 --- a/SoObjects/Mailer/SOGoMailManager.m +++ b/SoObjects/Mailer/SOGoMailManager.m @@ -20,6 +20,8 @@ */ #import +#import +#import #import #import @@ -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]; }