struct MailboxNode *np = NULL;
STAILQ_FOREACH(np, &a->mailboxes, entries)
{
- if (np->m == m)
+ if (np->mailbox == m)
{
STAILQ_REMOVE(&a->mailboxes, np, MailboxNode, entries);
break;
struct MailboxNode *np = NULL;
STAILQ_FOREACH(np, &AllMailboxes, entries)
{
- if (mutt_str_strcmp(buffer, np->m->path) != 0)
+ if (mutt_str_strcmp(buffer, np->mailbox->path) != 0)
break;
}
if (np && Context &&
- (mutt_str_strcmp(np->m->realpath, Context->mailbox->realpath) == 0))
+ (mutt_str_strcmp(np->mailbox->realpath, Context->mailbox->realpath) == 0))
{
- np->m->msg_count = Context->mailbox->msg_count;
- np->m->msg_unread = Context->mailbox->msg_unread;
+ np->mailbox->msg_count = Context->mailbox->msg_count;
+ np->mailbox->msg_unread = Context->mailbox->msg_unread;
}
- add_folder(menu, state, de->d_name, NULL, &s, np ? np->m : NULL, NULL);
+ add_folder(menu, state, de->d_name, NULL, &s, np ? np->mailbox : NULL, NULL);
}
closedir(dp);
}
struct MailboxNode *np = NULL;
STAILQ_FOREACH(np, &AllMailboxes, entries)
{
- if (Context && (mutt_str_strcmp(np->m->realpath, Context->mailbox->realpath) == 0))
+ if (Context && (mutt_str_strcmp(np->mailbox->realpath, Context->mailbox->realpath) == 0))
{
- np->m->msg_count = Context->mailbox->msg_count;
- np->m->msg_unread = Context->mailbox->msg_unread;
+ np->mailbox->msg_count = Context->mailbox->msg_count;
+ np->mailbox->msg_unread = Context->mailbox->msg_unread;
}
char buffer[PATH_MAX];
- mutt_str_strfcpy(buffer, np->m->path, sizeof(buffer));
+ mutt_str_strfcpy(buffer, np->mailbox->path, sizeof(buffer));
if (BrowserAbbreviateMailboxes)
mutt_pretty_mailbox(buffer, sizeof(buffer));
- switch (np->m->magic)
+ switch (np->mailbox->magic)
{
case MUTT_IMAP:
case MUTT_POP:
- add_folder(menu, state, buffer, np->m->desc, NULL, np->m, NULL);
+ add_folder(menu, state, buffer, np->mailbox->desc, NULL, np->mailbox, NULL);
continue;
case MUTT_NOTMUCH:
case MUTT_NNTP:
- add_folder(menu, state, np->m->path, np->m->desc, NULL, np->m, NULL);
+ add_folder(menu, state, np->mailbox->path, np->mailbox->desc, NULL, np->mailbox, NULL);
continue;
default: /* Continue */
break;
}
- if (lstat(np->m->path, &s) == -1)
+ if (lstat(np->mailbox->path, &s) == -1)
continue;
if ((!S_ISREG(s.st_mode)) && (!S_ISDIR(s.st_mode)) && (!S_ISLNK(s.st_mode)))
continue;
- if (np->m->magic == MUTT_MAILDIR)
+ if (np->mailbox->magic == MUTT_MAILDIR)
{
struct stat st2;
char md[PATH_MAX];
- snprintf(md, sizeof(md), "%s/new", np->m->path);
+ snprintf(md, sizeof(md), "%s/new", np->mailbox->path);
if (stat(md, &s) < 0)
s.st_mtime = 0;
- snprintf(md, sizeof(md), "%s/cur", np->m->path);
+ snprintf(md, sizeof(md), "%s/cur", np->mailbox->path);
if (stat(md, &st2) < 0)
st2.st_mtime = 0;
if (st2.st_mtime > s.st_mtime)
s.st_mtime = st2.st_mtime;
}
- add_folder(menu, state, buffer, np->m->desc, &s, np->m, NULL);
+ add_folder(menu, state, buffer, np->mailbox->desc, &s, np->mailbox, NULL);
}
}
browser_sort(state);
m->account = a;
struct MailboxNode *np = mutt_mem_calloc(1, sizeof(*np));
- np->m = m;
+ np->mailbox = m;
STAILQ_INSERT_TAIL(&a->mailboxes, np, entries);
return 0;
}
struct MailboxNode *np = NULL;
STAILQ_FOREACH(np, &AllMailboxes, entries)
{
- if (mutt_str_strcmp(tmp, np->m->path) == 0)
+ if (mutt_str_strcmp(tmp, np->mailbox->path) == 0)
break;
}
if (np)
{
(state->entry)[state->entrylen].has_mailbox = true;
- (state->entry)[state->entrylen].new = np->m->has_new;
- (state->entry)[state->entrylen].msg_count = np->m->msg_count;
- (state->entry)[state->entrylen].msg_unread = np->m->msg_unread;
+ (state->entry)[state->entrylen].new = np->mailbox->has_new;
+ (state->entry)[state->entrylen].msg_count = np->mailbox->msg_count;
+ (state->entry)[state->entrylen].msg_unread = np->mailbox->msg_unread;
}
(state->entrylen)++;
struct MailboxNode *np = NULL;
STAILQ_FOREACH(np, &AllMailboxes, entries)
{
- if (np->m->magic != MUTT_IMAP)
+ if (np->mailbox->magic != MUTT_IMAP)
continue;
- adata = imap_adata_get(np->m);
+ adata = imap_adata_get(np->mailbox);
// Pick first mailbox connected on the same server
if (imap_account_match(&adata->conn_account, &conn_account))
break;
struct MailboxNode *np = NULL;
STAILQ_FOREACH(np, &AllMailboxes, entries)
{
- if (!mutt_str_startswith(np->m->path, buf, CASE_MATCH))
+ if (!mutt_str_startswith(np->mailbox->path, buf, CASE_MATCH))
continue;
if (rc)
{
- mutt_str_strfcpy(buf, np->m->path, buflen);
+ mutt_str_strfcpy(buf, np->mailbox->path, buflen);
rc = 0;
}
else
- longest_common_prefix(buf, np->m->path, matchlen, buflen);
+ longest_common_prefix(buf, np->mailbox->path, matchlen, buflen);
}
#if 0
old_m->flags = MB_NORMAL;
mutt_sb_notify_mailbox(old_m, true);
struct MailboxNode *mn = mutt_mem_calloc(1, sizeof(*mn));
- mn->m = old_m;
+ mn->mailbox = old_m;
STAILQ_INSERT_TAIL(&AllMailboxes, mn, entries);
}
mailbox_free(&m);
}
struct MailboxNode *mn = mutt_mem_calloc(1, sizeof(*mn));
- mn->m = m;
+ mn->mailbox = m;
STAILQ_INSERT_TAIL(&AllMailboxes, mn, entries);
#ifdef USE_SIDEBAR
STAILQ_FOREACH_SAFE(np, &AllMailboxes, entries, nptmp)
{
/* Decide whether to delete all normal mailboxes or all virtual */
- bool virt = ((np->m->magic == MUTT_NOTMUCH) && (data & MUTT_VIRTUAL));
- bool norm = ((np->m->magic != MUTT_NOTMUCH) && !(data & MUTT_VIRTUAL));
+ bool virt = ((np->mailbox->magic == MUTT_NOTMUCH) && (data & MUTT_VIRTUAL));
+ bool norm = ((np->mailbox->magic != MUTT_NOTMUCH) && !(data & MUTT_VIRTUAL));
bool clear_this = clear_all && (virt || norm);
/* Compare against path or desc? Ensure 'tmp' is valid */
if (!clear_this && tmp_valid)
{
- clear_this = (mutt_str_strcasecmp(tmp, np->m->path) == 0) ||
- (mutt_str_strcasecmp(tmp, np->m->desc) == 0);
+ clear_this = (mutt_str_strcasecmp(tmp, np->mailbox->path) == 0) ||
+ (mutt_str_strcasecmp(tmp, np->mailbox->desc) == 0);
}
if (clear_this)
{
#ifdef USE_SIDEBAR
- mutt_sb_notify_mailbox(np->m, false);
+ mutt_sb_notify_mailbox(np->mailbox, false);
#endif
#ifdef USE_INOTIFY
- mutt_monitor_remove(np->m);
+ mutt_monitor_remove(np->mailbox);
#endif
- if (Context && (Context->mailbox == np->m))
+ if (Context && (Context->mailbox == np->mailbox))
{
- np->m->flags |= MB_HIDDEN;
+ np->mailbox->flags |= MB_HIDDEN;
}
else
{
- mx_ac_remove(np->m);
- mailbox_free(&np->m);
+ mx_ac_remove(np->mailbox);
+ mailbox_free(&np->mailbox);
}
STAILQ_REMOVE(&AllMailboxes, np, MailboxNode, entries);
FREE(&np);
struct MailboxNode *mp = NULL;
STAILQ_FOREACH(mp, &AllMailboxes, entries)
{
- if (mp->m->magic == MUTT_NOTMUCH)
+ if (mp->mailbox->magic == MUTT_NOTMUCH)
{
- cs_str_string_set(Config, "spoolfile", mp->m->path, NULL);
+ cs_str_string_set(Config, "spoolfile", mp->mailbox->path, NULL);
break;
}
}
struct MailboxNode *np = NULL;
STAILQ_FOREACH(np, &AllMailboxes, entries)
{
- if ((stat(np->m->path, &tmp_sb) == 0) && (sb.st_dev == tmp_sb.st_dev) &&
+ if ((stat(np->mailbox->path, &tmp_sb) == 0) && (sb.st_dev == tmp_sb.st_dev) &&
(sb.st_ino == tmp_sb.st_ino))
{
- return np->m;
+ return np->mailbox;
}
}
struct MailboxNode *np = NULL;
STAILQ_FOREACH(np, &AllMailboxes, entries)
{
- if (np->m->desc && mutt_str_strcmp(np->m->desc, desc) == 0)
- return np->m;
+ if (np->mailbox->desc && mutt_str_strcmp(np->mailbox->desc, desc) == 0)
+ return np->mailbox;
}
return NULL;
struct MailboxNode *np = NULL;
STAILQ_FOREACH(np, &AllMailboxes, entries)
{
- mailbox_check(m_cur, np->m, &contex_sb,
- check_stats || (!np->m->first_check_stats_done && MailCheckStats));
- np->m->first_check_stats_done = true;
+ mailbox_check(m_cur, np->mailbox, &contex_sb,
+ check_stats || (!np->mailbox->first_check_stats_done && MailCheckStats));
+ np->mailbox->first_check_stats_done = true;
}
return MailboxCount;
STAILQ_FOREACH(np, &AllMailboxes, entries)
{
/* Is there new mail in this mailbox? */
- if (!np->m->has_new || (have_unnotified && np->m->notified))
+ if (!np->mailbox->has_new || (have_unnotified && np->mailbox->notified))
continue;
- mutt_str_strfcpy(path, np->m->path, sizeof(path));
+ mutt_str_strfcpy(path, np->mailbox->path, sizeof(path));
mutt_pretty_mailbox(path, sizeof(path));
if (!first && (MuttMessageWindow->cols >= 7) &&
pos += strlen(strncat(mailboxlist + pos, ", ", sizeof(mailboxlist) - 1 - pos));
/* Prepend an asterisk to mailboxes not already notified */
- if (!np->m->notified)
+ if (!np->mailbox->notified)
{
/* pos += strlen (strncat(mailboxlist + pos, "*", sizeof(mailboxlist)-1-pos)); */
- np->m->notified = true;
+ np->mailbox->notified = true;
MailboxNotify--;
}
pos += strlen(strncat(mailboxlist + pos, path, sizeof(mailboxlist) - 1 - pos));
struct MailboxNode *np = NULL;
STAILQ_FOREACH(np, &AllMailboxes, entries)
{
- if (np->m->magic == MUTT_NOTMUCH) /* only match real mailboxes */
+ if (np->mailbox->magic == MUTT_NOTMUCH) /* only match real mailboxes */
continue;
- mutt_expand_path(np->m->path, sizeof(np->m->path));
- if ((found || pass) && np->m->has_new)
+ mutt_expand_path(np->mailbox->path, sizeof(np->mailbox->path));
+ if ((found || pass) && np->mailbox->has_new)
{
- mutt_str_strfcpy(s, np->m->path, slen);
+ mutt_str_strfcpy(s, np->mailbox->path, slen);
mutt_pretty_mailbox(s, slen);
return;
}
- if (mutt_str_strcmp(s, np->m->path) == 0)
+ if (mutt_str_strcmp(s, np->mailbox->path) == 0)
found = 1;
}
}
*/
struct MailboxNode
{
- struct Mailbox *m;
+ struct Mailbox *mailbox;
STAILQ_ENTRY(MailboxNode) entries;
};
if (!np)
return NULL;
- if (mutt_str_strcmp(np->m->path, path) != 0)
+ if (mutt_str_strcmp(np->mailbox->path, path) != 0)
return NULL;
return a;
struct MailboxNode *np = NULL;
STAILQ_FOREACH(np, &a->mailboxes, entries)
{
- if (mutt_str_strcmp(np->m->realpath, path) == 0)
- return np->m;
+ if (mutt_str_strcmp(np->mailbox->realpath, path) == 0)
+ return np->mailbox;
}
return NULL;
m->account = a;
struct MailboxNode *np = mutt_mem_calloc(1, sizeof(*np));
- np->m = m;
+ np->mailbox = m;
STAILQ_INSERT_TAIL(&a->mailboxes, np, entries);
return 0;
}
struct MailboxNode *np = NULL;
STAILQ_FOREACH(np, &AllMailboxes, entries)
{
- if ((np->m->magic == MUTT_NOTMUCH) && np->m->desc && (strcmp(desc, np->m->desc) == 0))
+ if ((np->mailbox->magic == MUTT_NOTMUCH) && np->mailbox->desc && (strcmp(desc, np->mailbox->desc) == 0))
{
- mutt_str_strfcpy(buf, np->m->path, buflen);
+ mutt_str_strfcpy(buf, np->mailbox->path, buflen);
buf[buflen - 1] = '\0';
return 0;
}
break;
int j = i;
- while ((j < EntryCount) && (Entries[j]->mailbox != np->m))
+ while ((j < EntryCount) && (Entries[j]->mailbox != np->mailbox))
j++;
if (j < EntryCount)
{
struct MailboxNode *np = NULL;
STAILQ_FOREACH(np, &AllMailboxes, entries)
{
- mutt_sb_notify_mailbox(np->m, true);
+ mutt_sb_notify_mailbox(np->mailbox, true);
}
}