X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=account.c;h=7838827f72aaefd68f057806f01e8a1a5cbde5e2;hp=d87c3e36be3e33c0fd43d58b87ff5424735c1ec3;hb=f3cbb9f51357972f6e74244494236a41dc4d84cd;hpb=cac1491258e026b8c8459b2ad408a6bf2e8a03bc diff --git a/account.c b/account.c index d87c3e3..7838827 100644 --- a/account.c +++ b/account.c @@ -9,28 +9,18 @@ /* remote host account manipulation (POP/IMAP) */ -#if HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include -#include -#include +#include +#include +#include #include "mutt.h" -#include "enter.h" #include "account.h" -#include "url.h" - /* mutt_account_match: compare account info (host/port/user/login) */ int mutt_account_match (const ACCOUNT * a1, const ACCOUNT * a2) { const char* user = NONULL (Username); -#ifdef USE_IMAP const char* login = NONULL (Username); -#endif if (a1->type != a2->type) return 0; @@ -39,19 +29,15 @@ int mutt_account_match (const ACCOUNT * a1, const ACCOUNT * a2) if (a1->port != a2->port) return 0; -#ifdef USE_IMAP if (a1->type == M_ACCT_TYPE_IMAP) { if (ImapUser && (ImapUser[0] != '\0')) user = ImapUser; if (ImapLogin && (ImapLogin[0] != '\0')) login = ImapLogin; } -#endif -#ifdef USE_POP if (a1->type == M_ACCT_TYPE_POP && PopUser) user = PopUser; -#endif #ifdef USE_NNTP if (a1->type == M_ACCT_TYPE_NNTP && NntpUser) @@ -103,23 +89,19 @@ void mutt_account_tourl (ACCOUNT * account, ciss_url_t * url) url->pass = NULL; url->port = 0; -#ifdef USE_IMAP if (account->type == M_ACCT_TYPE_IMAP) { if (account->flags & M_ACCT_SSL) url->scheme = U_IMAPS; else url->scheme = U_IMAP; } -#endif -#ifdef USE_POP if (account->type == M_ACCT_TYPE_POP) { if (account->flags & M_ACCT_SSL) url->scheme = U_POPS; else url->scheme = U_POP; } -#endif #ifdef USE_NNTP if (account->type == M_ACCT_TYPE_NNTP) { @@ -147,14 +129,10 @@ int mutt_account_getuser (ACCOUNT * account) /* already set */ if (account->flags & M_ACCT_USER) return 0; -#ifdef USE_IMAP else if ((account->type == M_ACCT_TYPE_IMAP) && !m_strisempty(ImapUser)) m_strcpy(account->user, sizeof(account->user), ImapUser); -#endif -#ifdef USE_POP else if ((account->type == M_ACCT_TYPE_POP) && !m_strisempty(PopUser)) m_strcpy(account->user, sizeof(account->user), PopUser); -#endif #ifdef USE_NNTP else if ((account->type == M_ACCT_TYPE_NNTP) && !m_strisempty(NntpUser)) m_strcpy(account->user, sizeof(account->user), NntpUser); @@ -178,7 +156,6 @@ int mutt_account_getlogin (ACCOUNT* account) /* already set */ if (account->flags & M_ACCT_LOGIN) return 0; -#ifdef USE_IMAP else if (account->type == M_ACCT_TYPE_IMAP) { if (!m_strisempty(ImapLogin)) { @@ -186,7 +163,6 @@ int mutt_account_getlogin (ACCOUNT* account) account->flags |= M_ACCT_LOGIN; } } -#endif if (!(account->flags & M_ACCT_LOGIN)) { mutt_account_getuser (account); @@ -205,14 +181,10 @@ int mutt_account_getpass (ACCOUNT * account) if (account->flags & M_ACCT_PASS) return 0; -#ifdef USE_IMAP else if ((account->type == M_ACCT_TYPE_IMAP) && !m_strisempty(ImapPass)) m_strcpy(account->pass, sizeof(account->pass), ImapPass); -#endif -#ifdef USE_POP else if ((account->type == M_ACCT_TYPE_POP) && !m_strisempty(PopPass)) m_strcpy(account->pass, sizeof(account->pass), PopPass); -#endif #ifdef USE_NNTP else if ((account->type == M_ACCT_TYPE_NNTP) && !m_strisempty(NntpPass)) m_strcpy(account->pass, sizeof(account->pass), NntpPass); @@ -234,5 +206,5 @@ int mutt_account_getpass (ACCOUNT * account) void mutt_account_unsetpass (ACCOUNT * account) { - account->flags &= !M_ACCT_PASS; + account->flags &= ~M_ACCT_PASS; }