projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix regression in mutt_is_application_pgp \o/
[apps/madmutt.git]
/
account.c
diff --git
a/account.c
b/account.c
index
d87c3e3
..
7838827
100644
(file)
--- a/
account.c
+++ b/
account.c
@@
-9,28
+9,18
@@
/* remote host account manipulation (POP/IMAP) */
/* remote host account manipulation (POP/IMAP) */
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
+#include <lib-ui/enter.h>
+#include <lib-ui/curses.h>
#include "mutt.h"
#include "mutt.h"
-#include "enter.h"
#include "account.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);
/* 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);
const char* login = NONULL (Username);
-#endif
if (a1->type != a2->type)
return 0;
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;
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;
}
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;
if (a1->type == M_ACCT_TYPE_POP && PopUser)
user = PopUser;
-#endif
#ifdef USE_NNTP
if (a1->type == M_ACCT_TYPE_NNTP && NntpUser)
#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;
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;
}
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;
}
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) {
#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;
/* 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);
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);
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);
#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;
/* 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)) {
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;
}
}
account->flags |= M_ACCT_LOGIN;
}
}
-#endif
if (!(account->flags & M_ACCT_LOGIN)) {
mutt_account_getuser (account);
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;
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);
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);
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);
#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)
{
void mutt_account_unsetpass (ACCOUNT * account)
{
- account->flags &=
!
M_ACCT_PASS;
+ account->flags &=
~
M_ACCT_PASS;
}
}