[M-CVS] CVS: M/src/mail MailFolderCC.cpp,1.654,1.655
Status: Beta
Brought to you by:
vadz
From: Vadim Z. <va...@us...> - 2003-03-30 00:24:40
|
Update of /cvsroot/mahogany/M/src/mail In directory sc8-pr-cvs1:/tmp/cvs-serv12455/src/mail Modified Files: MailFolderCC.cpp Log Message: do not close POP folders in Ping(), this leads to very bad consequences (== crashes); handle MP_POP_NO_AUTH flag Index: MailFolderCC.cpp =================================================================== RCS file: /cvsroot/mahogany/M/src/mail/MailFolderCC.cpp,v retrieving revision 1.654 retrieving revision 1.655 diff -b -u -2 -r1.654 -r1.655 --- MailFolderCC.cpp 29 Mar 2003 17:53:43 -0000 1.654 +++ MailFolderCC.cpp 30 Mar 2003 00:24:36 -0000 1.655 @@ -161,4 +161,5 @@ extern const MOption MP_MSGS_SERVER_THREAD_REF_ONLY; extern const MOption MP_NEWS_SPOOL_DIR; +extern const MOption MP_POP_NO_AUTH; extern const MOption MP_RSH_PATH; extern const MOption MP_SSH_PATH; @@ -1298,4 +1299,16 @@ case MF_POP: + { + // if we use SSL, we already have a profile object in local scope +#ifndef USE_SSL + Profile_obj profile(folder->GetProfile()); +#endif + if ( READ_CONFIG(profile, MP_POP_NO_AUTH) ) + { + // turn authentification off forcefully + spec << "/loser"; + } + } + spec << "/pop3}"; break; @@ -2640,15 +2653,16 @@ if ( lockFolder ) { - // c-client 4.7-bug: MH folders don't notice new messages without + // POP folders never notice any new messages until you close and reopen + // the session but it's a very bad idea to do it from inside Ping() as it + // can be called at any moment and closing the folder invalidates lots of + // data associated with it which can be completely unexpected (as we + // don't even get a "connection broken" notification!), so simply do + // nothing for them + // + // because of an apparent c-client bug, MH folders don't notice new mail // reopening them: check if this is still needed with imap2000 (TODO) - if ( GetType() == MF_POP || GetType() == MF_MH ) + const MFolderType type = GetType(); + if ( type != MF_POP || type != MF_MH ) { - wxLogTrace(TRACE_MF_CALLS, - _T("MailFolderCC::Ping() forcing close on folder %s."), - GetName().c_str()); - - Close(); - } - #ifdef USE_DIALUP if ( NeedsNetwork() && !mApplication->IsOnline() && @@ -2675,17 +2689,10 @@ #endif // USE_DIALUP - // try to reopen the folder if it is closed - if ( !m_MailStream ) - { - rc = Open(); - } - - if ( m_MailStream ) - { rc = PingOpenedFolder(); } - else + else // POP/MH folder { - rc = false; + // pretend that everything is ok even though we didn't do anything + rc = true; } } |