diff --git a/ChangeLog b/ChangeLog index 2fa3c237f..afbaff01e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-09-01 Wolfgang Sourdeau + + * SoObjects/Mailer/SOGoMailAccount.m ([SOGoMailAccount + +initialize]): use the user default "SOGoFallbackIMAP4Server" to + override the value of "serverName" from the actual user settings. + Fallback to "localhost" if value is unset. + + * SoObjects/Mailer/SOGoMailAccount.m ([SOGoMailAccount + -imap4URLString]): use the value of SOGoFallbackIMAP4Server, as + mentionne above. + 2008-08-29 Wolfgang Sourdeau * UI/MailerUI/UIxMailView.m ([UIxMailView diff --git a/SoObjects/Mailer/SOGoMailAccount.m b/SoObjects/Mailer/SOGoMailAccount.m index 976f3f98d..6d6274c05 100644 --- a/SoObjects/Mailer/SOGoMailAccount.m +++ b/SoObjects/Mailer/SOGoMailAccount.m @@ -57,6 +57,9 @@ static NSString *trashFolderName = nil; static NSString *sharedFolderName = @""; // TODO: add English default static NSString *otherUsersFolderName = @""; // TODO: add English default +// this is temporary, until we allow users to manage their own accounts +static NSString *fallbackIMAP4Server = nil; + + (void) initialize { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; @@ -95,7 +98,16 @@ static NSString *otherUsersFolderName = @""; // TODO: add English default else rootFolderNames = [[NSArray alloc] initWithObjects: draftsFolderName, - nil]; + nil]; + + if (!fallbackIMAP4Server) + { + fallbackIMAP4Server = [ud stringForKey: @"SOGoFallbackIMAP4Server"]; + if (fallbackIMAP4Server) + [fallbackIMAP4Server retain]; + else + fallbackIMAP4Server = @"localhost"; + } } - (id) init @@ -258,8 +270,14 @@ static NSString *otherUsersFolderName = @""; // TODO: add English default escUsername = [[username stringByEscapingURL] stringByReplacingString: @"@" withString: @"%40"]; +#if 0 + // see comment about fallbackIMAP4Server above hostString = [NSString stringWithFormat: @"%@@%@", escUsername, [mailAccount objectForKey: @"serverName"]]; +#else + hostString = [NSString stringWithFormat: @"%@@%@", escUsername, + fallbackIMAP4Server]; +#endif } else hostString = @"localhost";