int uid_checked = 0;
int server_changes = 0;
- struct ImapMboxData *mdata = adata->mailbox->mdata;
+ struct ImapMboxData *mdata = imap_mdata_get(adata->mailbox);
mutt_debug(3, "Handling FETCH\n");
url_tostring(&url, path, sizeof(path), 0);
struct Mailbox *m = mx_mbox_find2(path);
- if (!m || !m->mdata)
+ struct ImapMboxData *mdata = imap_mdata_get(m);
+ if (!mdata)
{
mutt_debug(3, "Received status for an unexpected mailbox: %s\n", mailbox);
return;
}
- struct ImapMboxData *mdata = m->mdata;
olduv = mdata->uid_validity;
oldun = mdata->uid_next;
int rc;
const char *condstore = NULL;
- struct ImapAccountData *adata = m->account->adata;
- struct ImapMboxData *mdata = m->mdata;
+ struct ImapAccountData *adata = imap_adata_get(m);
+ struct ImapMboxData *mdata = imap_mdata_get(m);
imap_qualify_path(buf, sizeof(buf), &adata->conn_account, mdata->name);
mutt_str_strfcpy(m->path, buf, sizeof(m->path));
*/
static int imap_mbox_open_append(struct Mailbox *m, int flags)
{
- if (!m)
+ if (!m || !m->account)
return -1;
int rc;
/* in APPEND mode, we appear to hijack an existing IMAP connection -
* ctx is brand new and mostly empty */
- struct ImapAccountData *adata = m->account->adata;
- struct ImapMboxData *mdata = m->mdata;
+ struct ImapAccountData *adata = imap_adata_get(m);
+ struct ImapMboxData *mdata = imap_mdata_get(m);
rc = imap_mailbox_status(m, false);
if (rc >= 0)
*/
static int imap_tags_edit(struct Mailbox *m, const char *tags, char *buf, size_t buflen)
{
- if (!m || !m->mdata)
+ struct ImapMboxData *mdata = imap_mdata_get(m);
+ if (!mdata)
return -1;
char *new = NULL;
char *checker = NULL;
- struct ImapMboxData *mdata = m->mdata;
/* Check for \* flags capability */
if (!imap_has_flag(&mdata->flags, NULL))
char buf[LONG_STRING];
struct Mailbox *m = adata->mailbox;
- struct ImapMboxData *mdata = m->mdata;
+ struct ImapMboxData *mdata = imap_mdata_get(m);
int idx = m->msg_count;
/* L10N:
unsigned int header_msn = 0;
struct Mailbox *m = adata->mailbox;
- struct ImapMboxData *mdata = m->mdata;
+ struct ImapMboxData *mdata = imap_mdata_get(m);
/* L10N: Fetching IMAP flag changes, using the CONDSTORE extension */
mutt_progress_init(&progress, _("Fetching flag updates..."),
#endif /* USE_HCACHE */
struct Mailbox *m = adata->mailbox;
- struct ImapMboxData *mdata = m->mdata;
+ struct ImapMboxData *mdata = imap_mdata_get(m);
/* make sure context has room to hold the mailbox */
while (msn_end > m->hdrmax)
int output_progress;
struct ImapAccountData *adata = imap_adata_get(m);
- struct ImapMboxData *mdata = m->mdata;
+ struct ImapMboxData *mdata = imap_mdata_get(m);
struct Email *e = m->hdrs[msgno];
msg->fp = msg_cache_get(adata, e);
*/
void imap_allow_reopen(struct Mailbox *m)
{
- if (!m)
- return;
struct ImapAccountData *adata = imap_adata_get(m);
- if (!adata || !adata->mailbox || adata->mailbox != m)
+ struct ImapMboxData *mdata = imap_mdata_get(m);
+ if (!adata || !adata->mailbox || adata->mailbox != m || !mdata)
return;
-
- struct ImapMboxData *mdata = m->mdata;
mdata->reopen |= IMAP_REOPEN_ALLOW;
}
*/
void imap_disallow_reopen(struct Mailbox *m)
{
- if (!m)
- return;
struct ImapAccountData *adata = imap_adata_get(m);
- if (!adata || !adata->mailbox || adata->mailbox != m)
+ struct ImapMboxData *mdata = imap_mdata_get(m);
+ if (!adata || !adata->mailbox || adata->mailbox != m || !mdata)
return;
-
- struct ImapMboxData *mdata = m->mdata;
mdata->reopen &= ~IMAP_REOPEN_ALLOW;
}