projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove the stupid macro, we are big kids enough to write NULL, NULL.
[apps/madmutt.git]
/
imap
/
imap.c
diff --git
a/imap/imap.c
b/imap/imap.c
index
a9f5788
..
8fd96f8
100644
(file)
--- a/
imap/imap.c
+++ b/
imap/imap.c
@@
-299,7
+299,6
@@
IMAP_DATA *imap_conn_find (const ACCOUNT * account, int flags)
CONNECTION *conn;
IMAP_DATA *idata;
ACCOUNT *creds;
CONNECTION *conn;
IMAP_DATA *idata;
ACCOUNT *creds;
- int new = 0;
if (!(conn = mutt_conn_find (NULL, account)))
return NULL;
if (!(conn = mutt_conn_find (NULL, account)))
return NULL;
@@
-332,26
+331,28
@@
IMAP_DATA *imap_conn_find (const ACCOUNT * account, int flags)
idata = imap_new_idata();
conn->data = idata;
idata->conn = conn;
idata = imap_new_idata();
conn->data = idata;
idata->conn = conn;
- new = 1;
}
if (idata->state == IMAP_DISCONNECTED)
imap_open_connection (idata);
if (idata->state == IMAP_CONNECTED) {
}
if (idata->state == IMAP_DISCONNECTED)
imap_open_connection (idata);
if (idata->state == IMAP_CONNECTED) {
- if (!imap_authenticate
(idata)) {
+ if (!imap_authenticate(idata)) {
idata->state = IMAP_AUTHENTICATED;
} else {
idata->state = IMAP_AUTHENTICATED;
} else {
+ mutt_socket_close(idata->conn);
+ idata->state = IMAP_DISCONNECTED;
idata->conn->account.has_pass = 0;
}
p_delete(&idata->capstr);
}
idata->conn->account.has_pass = 0;
}
p_delete(&idata->capstr);
}
- if (new && idata->state == IMAP_AUTHENTICATED) {
+ if (
idata->is
new && idata->state == IMAP_AUTHENTICATED) {
imap_get_delim (idata);
if (option (OPTIMAPCHECKSUBSCRIBED)) {
mutt_message _("Checking mailbox subscriptions");
imap_exec (idata, "LSUB \"\" \"*\"", 0);
}
imap_get_delim (idata);
if (option (OPTIMAPCHECKSUBSCRIBED)) {
mutt_message _("Checking mailbox subscriptions");
imap_exec (idata, "LSUB \"\" \"*\"", 0);
}
+ idata->isnew = 0;
}
return idata;
}
return idata;
@@
-1335,8
+1336,6
@@
int imap_subscribe (char *path, int subscribe)
IMAP_DATA *idata;
char buf[LONG_STRING];
char mbox[LONG_STRING];
IMAP_DATA *idata;
char buf[LONG_STRING];
char mbox[LONG_STRING];
- char errstr[STRING];
- BUFFER err, token;
IMAP_MBOX mx;
if (mx_get_magic (path) != M_IMAP || imap_parse_path (path, &mx) < 0) {
IMAP_MBOX mx;
if (mx_get_magic (path) != M_IMAP || imap_parse_path (path, &mx) < 0) {
@@
-1352,13
+1351,7
@@
int imap_subscribe (char *path, int subscribe)
imap_fix_path (idata, mx.mbox, buf, sizeof (buf));
if (option (OPTIMAPCHECKSUBSCRIBED)) {
imap_fix_path (idata, mx.mbox, buf, sizeof (buf));
if (option (OPTIMAPCHECKSUBSCRIBED)) {
- p_clear(&token, 1);
- err.data = errstr;
- err.dsize = sizeof (errstr);
- snprintf (mbox, sizeof (mbox), "%smailboxes \"%s\"",
- subscribe ? "" : "un", path);
- mutt_parse_rc_line (mbox, &token, &err);
- p_delete(&token.data);
+ buffy_do_mailboxes(path, subscribe);
}
if (subscribe)
}
if (subscribe)
@@
-1569,7
+1562,7
@@
static int imap_open_new_message (MESSAGE * msg,
{
char tmp[_POSIX_PATH_MAX];
{
char tmp[_POSIX_PATH_MAX];
- msg->fp = m_tempfile(tmp, sizeof(tmp), NONULL(
MC
ore.tmpdir), NULL);
+ msg->fp = m_tempfile(tmp, sizeof(tmp), NONULL(
mod_c
ore.tmpdir), NULL);
if (!msg->fp) {
mutt_perror(tmp);
return -1;
if (!msg->fp) {
mutt_perror(tmp);
return -1;