]> granicus.if.org Git - neomutt/commit
Change imap_conn_find() to always return an authenticated conn.
authorKevin McCarthy <kevin@8t8.us>
Thu, 13 Sep 2018 01:23:00 +0000 (18:23 -0700)
committerRichard Russon <rich@flatcap.org>
Tue, 25 Sep 2018 12:23:50 +0000 (13:23 +0100)
commitd031f408163ff787b0222fd324fd170e73249103
tree2f6ba6b9512e89e602825d3cb47bbda9bcaaba2d
parent5fa35b40439a9fc9cacfdeff0c135083603c6bab
Change imap_conn_find() to always return an authenticated conn.

With the flag MUTT_IMAP_CONN_NONEW, it was already ensured the
connection would be authenticated.  However, without that flag, an
error in opening the connection or authentication would still return
an idata.

The callers that didn't bother to check the state were still assuming
authenticated, because they were all subseqeuently issuing an
"authenticated state" command to the server.

Rather than add state checks to every caller, just change the function
to return NULL if the idata did not end up in an authenticated state.

Remove the now redundant state checks in imap_open_mailbox() and
imap_get_mailbox().
imap/imap.c