- Updated French translation
- Fix imap sync segfault due to inactive headers during an expunge
- Close the imap socket for the selected mailbox on error
- - Add missing IMAP_CMD_POLL flag in imap buffy check
+ - Add missing IMAP_CMD_POLL flag in imap mailbox check
- Change maildir and mh check_mailbox to use dynamic sized hash
- Fix uses of context->changed as a counter
- Make cmd_parse_fetch() more precise about setting reopen/check flags
* Tidy
- drop VirtIncoming
- split mutt_parse_mailboxes into mutt_parse_unmailboxes
- - tidy some buffy code
+ - tidy some mailbox code
- tidy the version strings
* Upstream
- Add ~<() and ~>() immediate parent/children patterns
- Add option for missing subject replacement
- notmuch: Allow <modify-labels> to toggle labels
- Support for aborting mailbox loading
- - Do a buffy check after shell escape
+ - Do a mailbox check after shell escape
- Support of relative paths sourcing and cyclic source detection
- Support of multiple config files as CLI arguments
- Extend the ~m pattern to allow relative ranges
- Add sidebar_format flag '%n' to display 'N' on new mail.
- fix index_format truncation problem
- Fix compiler warnings due to always true condition
- - Change sidebar next/prev-new to look at buffy->new too.
+ - Change sidebar next/prev-new to look at mailbox->new too.
- Change the default for sidebar_format to use %n.
- - sidebar "unsorted" order to match Buffy list order.
+ - sidebar "unsorted" order to match Mailbox list order.
- Include ncurses tinfo library if found.
- Sidebar width problem
- sidebar crash for non-existent mailbox
- Temporary compatibility workaround
- - Reset buffy->new for the current mailbox in IMAP.
+ - Reset mailbox->new for the current mailbox in IMAP.
- version.sh regression
- crash when notmuch tries to read a message
- status line wrapping
- Single quote at line beginning misinterpreted by groff
- Setting $sidebar_width to more than 128 would cause bad things to happen.
- Fix alignment in the compose menu.
- - Fix sidebar buffy stats updating on mailbox close.
+ - Fix sidebar mailbox stats updating on mailbox close.
* Build Changes
- Sync whitespace to mutt/default
- Alter ChangeLog date format to simplify Makefiles
struct FolderFile *pb = (struct FolderFile *) b;
int r = 0;
- if (pa->has_buffy && pb->has_buffy)
+ if (pa->has_mailbox && pb->has_mailbox)
r = pa->msg_count - pb->msg_count;
- else if (pa->has_buffy)
+ else if (pa->has_mailbox)
r = -1;
else
r = 1;
struct FolderFile *pb = (struct FolderFile *) b;
int r = 0;
- if (pa->has_buffy && pb->has_buffy)
+ if (pa->has_mailbox && pb->has_mailbox)
r = pa->msg_unread - pb->msg_unread;
- else if (pa->has_buffy)
+ else if (pa->has_mailbox)
r = -1;
else
r = 1;
case 'm':
if (!optional)
{
- if (folder->ff->has_buffy)
+ if (folder->ff->has_mailbox)
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
snprintf(buf, buflen, fmt, folder->ff->msg_count);
case 'n':
if (!optional)
{
- if (folder->ff->has_buffy)
+ if (folder->ff->has_mailbox)
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
snprintf(buf, buflen, fmt, folder->ff->msg_unread);
if (b)
{
- (state->entry)[state->entrylen].has_buffy = true;
+ (state->entry)[state->entrylen].has_mailbox = true;
(state->entry)[state->entrylen].new = b->new;
(state->entry)[state->entrylen].msg_count = b->msg_count;
(state->entry)[state->entrylen].msg_unread = b->msg_unread;
return -1;
}
- mutt_buffy_check(0);
+ mutt_mailbox_check(0);
dp = opendir(d);
if (!dp)
if (STAILQ_EMPTY(&AllMailboxes))
return -1;
- mutt_buffy_check(0);
+ mutt_mailbox_check(0);
init_state(state, menu);
if (STAILQ_EMPTY(&AllMailboxes))
return -1;
- mutt_buffy_check(0);
+ mutt_mailbox_check(0);
struct MailboxNode *np = NULL;
STAILQ_FOREACH(np, &AllMailboxes, entries)
* @param menu Current menu
* @param title Buffer for the title
* @param titlelen Length of buffer
- * @param buffy If true, select mailboxes
+ * @param mailbox If true, select mailboxes
*/
static void init_menu(struct BrowserState *state, struct Menu *menu,
- char *title, size_t titlelen, bool buffy)
+ char *title, size_t titlelen, bool mailbox)
{
menu->max = state->entrylen;
#ifdef USE_NNTP
if (OptNews)
{
- if (buffy)
+ if (mailbox)
snprintf(title, titlelen, _("Subscribed newsgroups"));
else
{
else
#endif
{
- if (buffy)
+ if (mailbox)
{
menu->is_mailbox_list = 1;
- snprintf(title, titlelen, _("Mailboxes [%d]"), mutt_buffy_check(0));
+ snprintf(title, titlelen, _("Mailboxes [%d]"), mutt_mailbox_check(0));
}
else
{
break;
case OP_MAILBOX_LIST:
- mutt_buffy_list();
+ mutt_mailbox_list();
break;
case OP_BROWSER_NEW_FILE:
bool selectable : 1;
bool inferiors : 1;
#endif
- bool has_buffy : 1;
+ bool has_mailbox : 1;
bool local : 1; /**< folder is on local filesystem */
bool tagged : 1;
#ifdef USE_NNTP
if ((rc != 0) || WaitKey)
mutt_any_key_to_continue(NULL);
- mutt_buffy_check(MUTT_MAILBOX_CHECK_FORCE);
+ mutt_mailbox_check(MUTT_MAILBOX_CHECK_FORCE);
}
/**
}
}
- const int need_buffy_cleanup = (ctx.magic == MUTT_MBOX || ctx.magic == MUTT_MMDF);
+ const int need_mailbox_cleanup = (ctx.magic == MUTT_MBOX || ctx.magic == MUTT_MMDF);
mx_mbox_close(&ctx, NULL);
- if (need_buffy_cleanup)
- mutt_buffy_cleanup(buf, &st);
+ if (need_mailbox_cleanup)
+ mutt_mailbox_cleanup(buf, &st);
mutt_clear_error();
return 0;
*/
void mutt_check_stats(void)
{
- mutt_buffy_check(MUTT_MAILBOX_CHECK_FORCE | MUTT_MAILBOX_CHECK_FORCE_STATS);
+ mutt_mailbox_check(MUTT_MAILBOX_CHECK_FORCE | MUTT_MAILBOX_CHECK_FORCE_STATS);
}
struct Context
{
char *path;
- char *realpath; /**< used for buffy comparison and the sidebar */
+ char *realpath; /**< used for mailbox comparison and the sidebar */
FILE *fp;
time_t atime;
time_t mtime;
* @param[in] prompt Prompt
* @param[in] buf Buffer for the result
* @param[in] buflen Length of the buffer
- * @param[in] buffy If true, select mailboxes
+ * @param[in] mailbox If true, select mailboxes
* @param[in] multiple Allow multiple selections
* @param[out] files List of files selected
* @param[out] numfiles Number of files selected
* @retval 0 Success
* @retval -1 Error
*/
-int mutt_enter_fname_full(const char *prompt, char *buf, size_t buflen, bool buffy,
+int mutt_enter_fname_full(const char *prompt, char *buf, size_t buflen, bool mailbox,
bool multiple, char ***files, int *numfiles, int flags)
{
struct Event ch;
flags = MUTT_SEL_FOLDER;
if (multiple)
flags |= MUTT_SEL_MULTI;
- if (buffy)
+ if (mailbox)
flags |= MUTT_SEL_MAILBOX;
mutt_select_file(buf, buflen, flags, files, numfiles);
}
sprintf(pc, "%s: ", prompt);
mutt_unget_event(ch.op ? 0 : ch.ch, ch.op ? ch.op : 0);
- if (mutt_get_field_full(pc, buf, buflen, (buffy ? MUTT_EFILE : MUTT_FILE) | MUTT_CLEAR,
+ if (mutt_get_field_full(pc, buf, buflen, (mailbox ? MUTT_EFILE : MUTT_FILE) | MUTT_CLEAR,
multiple, files, numfiles) != 0)
{
buf[0] = '\0';
int mutt_do_pager(const char *banner, const char *tempfile, int do_color, struct Pager *info);
void mutt_edit_file(const char *editor, const char *file);
void mutt_endwin(void);
-int mutt_enter_fname_full(const char *prompt, char *buf, size_t blen, bool buffy, bool multiple, char ***files, int *numfiles, int flags);
+int mutt_enter_fname_full(const char *prompt, char *buf, size_t blen, bool mailbox, bool multiple, char ***files, int *numfiles, int flags);
void mutt_flushinp(void);
void mutt_flush_macro_to_endcond(void);
void mutt_flush_unget_to_endcond(void);
collapse_all(menu, 0);
#ifdef USE_SIDEBAR
- mutt_sb_set_open_buffy();
+ mutt_sb_set_open_mailbox();
#endif
mutt_clear_error();
- mutt_buffy_check(MUTT_MAILBOX_CHECK_FORCE); /* force the buffy check after we have changed the folder */
+ mutt_mailbox_check(MUTT_MAILBOX_CHECK_FORCE); /* force the mailbox check after we have changed the folder */
menu->redraw = REDRAW_FULL;
OptSearchInvalid = true;
#ifdef USE_SIDEBAR
if (menu->redraw & REDRAW_SIDEBAR)
{
- mutt_sb_set_buffystats(Context);
+ mutt_sb_set_mailbox_stats(Context);
menu_redraw_sidebar(menu);
}
#endif
int rc = -1;
char *cp = NULL; /* temporary variable. */
int index_hint; /* used to restore cursor position */
- bool do_buffy_notify = true;
+ bool do_mailbox_notify = true;
int close = 0; /* did we OP_QUIT or OP_EXIT out of this menu? */
int attach_msg = OptAttachMsg;
if (!attach_msg)
{
- /* force the buffy check after we enter the folder */
- mutt_buffy_check(MUTT_MAILBOX_CHECK_FORCE);
+ /* force the mailbox check after we enter the folder */
+ mutt_mailbox_check(MUTT_MAILBOX_CHECK_FORCE);
}
if (((Sort & SORT_MASK) == SORT_THREADS) && CollapseAll)
else if (check == MUTT_FLAGS)
mutt_message(_("Mailbox was externally modified."));
- /* avoid the message being overwritten by buffy */
- do_buffy_notify = false;
+ /* avoid the message being overwritten by mailbox */
+ do_mailbox_notify = false;
bool q = Context->quiet;
Context->quiet = true;
{
/* check for new mail in the incoming folders */
oldcount = newcount;
- newcount = mutt_buffy_check(0);
+ newcount = mutt_mailbox_check(0);
if (newcount != oldcount)
menu->redraw |= REDRAW_STATUS;
- if (do_buffy_notify)
+ if (do_mailbox_notify)
{
- if (mutt_buffy_notify())
+ if (mutt_mailbox_notify())
{
menu->redraw |= REDRAW_STATUS;
if (BeepNew)
}
}
else
- do_buffy_notify = true;
+ do_mailbox_notify = true;
}
if (op >= 0)
{
mutt_str_strfcpy(buf, Context->path, sizeof(buf));
mutt_pretty_mailbox(buf, sizeof(buf));
- mutt_buffy(buf, sizeof(buf));
+ mutt_mailbox(buf, sizeof(buf));
if (!buf[0])
{
mutt_error(_("No mailboxes have new mail"));
if (Context && (Context->magic == MUTT_NOTMUCH))
{
mutt_str_strfcpy(buf, Context->path, sizeof(buf));
- mutt_buffy_vfolder(buf, sizeof(buf));
+ mutt_mailbox_vfolder(buf, sizeof(buf));
}
mutt_enter_vfolder(cp, buf, sizeof(buf), 1);
if (!buf[0])
cp = _("Open newsgroup in read-only mode");
else
cp = _("Open newsgroup");
- nntp_buffy(buf, sizeof(buf));
+ nntp_mailbox(buf, sizeof(buf));
}
else
#endif
/* By default, fill buf with the next mailbox that contains unread
* mail */
- mutt_buffy(buf, sizeof(buf));
+ mutt_mailbox(buf, sizeof(buf));
if (mutt_enter_fname(cp, buf, sizeof(buf), 1) == -1)
{
main_change_folder(menu, op, buf, sizeof(buf), &oldcount, &index_hint);
#ifdef USE_NNTP
- /* mutt_buffy_check() must be done with mail-reader mode! */
+ /* mutt_mailbox_check() must be done with mail-reader mode! */
menu->help = mutt_compile_help(
helpstr, sizeof(helpstr), MENU_MAIN,
(Context && (Context->magic == MUTT_NNTP)) ? IndexNewsHelp : IndexHelp);
#endif
mutt_expand_path(buf, sizeof(buf));
#ifdef USE_SIDEBAR
- mutt_sb_set_open_buffy();
+ mutt_sb_set_open_mailbox();
#endif
break;
break;
case OP_MAILBOX_LIST:
- mutt_buffy_list();
+ mutt_mailbox_list();
break;
case OP_VIEW_ATTACHMENTS:
</para>
<para>
For the pager, index and directory browser menus, NeoMutt contains
- the <literal><buffy-list></literal> function (bound to
+ the <literal><mailbox-list></literal> function (bound to
<quote>.</quote> by default) which will print a list of folders with
new mail in the command line at the bottom of the screen.
</para>
<emphasis role="comment"># The character to use as the divider between the Sidebar and the other NeoMutt</emphasis>
<emphasis role="comment"># panels.</emphasis>
set sidebar_divider_char = '|'
-<emphasis role="comment"># Enable extended buffy mode to calculate total, new, and flagged</emphasis>
+<emphasis role="comment"># Enable extended mailbox mode to calculate total, new, and flagged</emphasis>
<emphasis role="comment"># message counts for each mailbox.</emphasis>
set mail_check_stats
<emphasis role="comment"># Display the Sidebar mailboxes using this format string.</emphasis>
fI
Cx
dt
-buffy
manny
applica
autoview
{
first = 1; /* clear input if user types a real key later */
mutt_mb_wcstombs(buf, buflen, state->wbuf, state->curpos);
- mutt_buffy(buf, buflen);
+ mutt_mailbox(buf, buflen);
state->curpos = state->lastchar =
mutt_mb_mbstowcs(&state->wbuf, &state->wbuflen, 0, buf);
break;
const struct Binding OpMain[] = { /* map: index */
{ "bounce-message", OP_BOUNCE_MESSAGE, "b" },
{ "break-thread", OP_MAIN_BREAK_THREAD, "#" },
- { "buffy-list", OP_MAILBOX_LIST, "." },
#ifdef USE_NNTP
{ "catchup", OP_CATCHUP, NULL },
#endif
{ "list-reply", OP_LIST_REPLY, "L" },
{ "mail", OP_MAIL, "m" },
{ "mail-key", OP_MAIL_KEY, "\033k" },
+ { "mailbox-list", OP_MAILBOX_LIST, "." },
{ "mark-message", OP_MARK_MSG, "~" },
{ "modify-labels", OP_MAIN_MODIFY_TAGS, NULL }, // NOTE(sileht): kept for backward compatibility
{ "modify-labels-then-hide", OP_MAIN_MODIFY_TAGS_THEN_HIDE, NULL }, // NOTE(sileht): kept for backward compatibility
#endif
{ "view-attachments", OP_VIEW_ATTACHMENTS, "v" },
{ "view-raw-message", OP_VIEW_RAW_MESSAGE, NULL },
+ /* This is deprecated. Leave it last so it doesn't show up in the help. */
+ { "buffy-list", OP_MAILBOX_LIST, NULL },
{ NULL, 0, NULL },
};
{ "bottom", OP_PAGER_BOTTOM, NULL },
{ "bounce-message", OP_BOUNCE_MESSAGE, "b" },
{ "break-thread", OP_MAIN_BREAK_THREAD, "#" },
- { "buffy-list", OP_MAILBOX_LIST, "." },
{ "change-folder", OP_MAIN_CHANGE_FOLDER, "c" },
{ "change-folder-readonly", OP_MAIN_CHANGE_FOLDER_READONLY, "\033c" },
#ifdef USE_NNTP
{ "list-reply", OP_LIST_REPLY, "L" },
{ "mail", OP_MAIL, "m" },
{ "mail-key", OP_MAIL_KEY, "\033k" },
+ { "mailbox-list", OP_MAILBOX_LIST, "." },
{ "mark-as-new", OP_TOGGLE_NEW, "N" },
{ "modify-labels", OP_MAIN_MODIFY_TAGS, NULL }, // NOTE(sileht): kept for backward compatibility
{ "modify-labels-then-hide", OP_MAIN_MODIFY_TAGS_THEN_HIDE, NULL }, // NOTE(sileht): kept for backward compatibility
{ "view-attachments", OP_VIEW_ATTACHMENTS, "v" },
{ "view-raw-message", OP_VIEW_RAW_MESSAGE, NULL },
{ "what-key", OP_WHAT_KEY, NULL },
+ /* This is deprecated. Leave it last so it doesn't show up in the help. */
+ { "buffy-list", OP_MAILBOX_LIST, NULL },
{ NULL, 0, NULL },
};
/* The file browser */
const struct Binding OpBrowser[] = { /* map: browser */
- { "buffy-list", OP_MAILBOX_LIST, "." },
#ifdef USE_NNTP
{ "catchup", OP_CATCHUP, NULL },
#endif
{ "enter-mask", OP_ENTER_MASK, "m" },
{ "goto-folder", OP_BROWSER_GOTO_FOLDER, "=" },
{ "goto-parent", OP_GOTO_PARENT, "p" },
+ { "mailbox-list", OP_MAILBOX_LIST, "." },
#ifdef USE_NNTP
{ "reload-active", OP_LOAD_ACTIVE, NULL },
#endif
{ "unsubscribe-pattern", OP_UNSUBSCRIBE_PATTERN, NULL },
#endif
{ "view-file", OP_BROWSER_VIEW_FILE, " " },
+ /* This is deprecated. Leave it last so it doesn't show up in the help. */
+ { "buffy-list", OP_MAILBOX_LIST, NULL },
{ NULL, 0, NULL },
};
{ "backward-char", OP_EDITOR_BACKWARD_CHAR, "\002" },
{ "backward-word", OP_EDITOR_BACKWARD_WORD, "\033b" },
{ "bol", OP_EDITOR_BOL, "\001" },
- { "buffy-cycle", OP_EDITOR_MAILBOX_CYCLE, " " },
{ "capitalize-word", OP_EDITOR_CAPITALIZE_WORD, "\033c" },
{ "complete", OP_EDITOR_COMPLETE, "\t" },
{ "complete-query", OP_EDITOR_COMPLETE_QUERY, "\024" },
{ "kill-eow", OP_EDITOR_KILL_EOW, "\033d" },
{ "kill-line", OP_EDITOR_KILL_LINE, "\025" },
{ "kill-word", OP_EDITOR_KILL_WORD, "\027" },
+ { "mailbox-cycle", OP_EDITOR_MAILBOX_CYCLE, " " },
{ "quote-char", OP_EDITOR_QUOTE_CHAR, "\026" },
{ "transpose-chars", OP_EDITOR_TRANSPOSE_CHARS, NULL },
{ "upcase-word", OP_EDITOR_UPCASE_WORD, "\033u" },
+ /* This is deprecated. Leave it last so it doesn't show up in the help. */
+ { "buffy-cycle", OP_EDITOR_MAILBOX_CYCLE, NULL },
{ NULL, 0, NULL },
};
np->b->msg_count = Context->msgcount;
np->b->msg_unread = Context->unread;
}
- (state->entry)[state->entrylen].has_buffy = true;
+ (state->entry)[state->entrylen].has_mailbox = true;
(state->entry)[state->entrylen].new = np->b->new;
(state->entry)[state->entrylen].msg_count = np->b->msg_count;
(state->entry)[state->entrylen].msg_unread = np->b->msg_unread;
* @param idata Server data
* @param s Command string with status info
*
- * first cut: just do buffy update. Later we may wish to cache all mailbox
- * information, even that not desired by buffy
+ * first cut: just do mailbox update. Later we may wish to cache all mailbox
+ * information, even that not desired by mailbox
*/
static void cmd_parse_status(struct ImapData *idata, char *s)
{
mutt_debug(3, "Running default STATUS handler\n");
- /* should perhaps move this code back to imap_buffy_check */
+ /* should perhaps move this code back to imap_mailbox_check */
struct MailboxNode *np = NULL;
STAILQ_FOREACH(np, &AllMailboxes, entries)
{
if (value && (imap_mxcmp(mailbox, value) == 0))
{
- mutt_debug(3, "Found %s in buffy list (OV: %u ON: %u U: %d)\n", mailbox,
- olduv, oldun, status->unseen);
+ mutt_debug(3, "Found %s in mailbox list (OV: %u ON: %u U: %d)\n",
+ mailbox, olduv, oldun, status->unseen);
if (MailCheckRecent)
{
}
/**
- * imap_buffy_check - Check for new mail in subscribed folders
+ * imap_mailbox_check - Check for new mail in subscribed folders
* @param check_stats Check for message stats too
* @retval num Number of mailboxes with new mail
* @retval 0 Failure
* Given a list of mailboxes rather than called once for each so that it can
* batch the commands and save on round trips.
*/
-int imap_buffy_check(int check_stats)
+int imap_mailbox_check(int check_stats)
{
struct ImapData *idata = NULL;
struct ImapData *lastdata = NULL;
if (lastdata && idata != lastdata)
{
- /* Send commands to previous server. Sorting the buffy list
+ /* Send commands to previous server. Sorting the mailbox list
* may prevent some infelicitous interleavings */
if (imap_exec(lastdata, NULL, IMAP_CMD_FAIL_OK | IMAP_CMD_POLL) == -1)
mutt_debug(1, "#1 Error polling mailboxes\n");
int imap_check_mailbox(struct Context *ctx, int force);
int imap_delete_mailbox(struct Context *ctx, struct ImapMbox *mx);
int imap_sync_mailbox(struct Context *ctx, int expunge);
-int imap_buffy_check(int check_stats);
+int imap_mailbox_check(int check_stats);
int imap_status(char *path, int queue);
int imap_search(struct Context *ctx, const struct Pattern *pat);
int imap_subscribe(char *path, bool subscribe);
}
/**
- * buffy_new - Create a new Maibox
+ * mailbox_new - Create a new Maibox
* @param path Path to the mailbox
* @retval ptr New Mailbox
*/
-static struct Mailbox *buffy_new(const char *path)
+static struct Mailbox *mailbox_new(const char *path)
{
char rp[PATH_MAX] = "";
- struct Mailbox *buffy = mutt_mem_calloc(1, sizeof(struct Mailbox));
- mutt_str_strfcpy(buffy->path, path, sizeof(buffy->path));
+ struct Mailbox *mailbox = mutt_mem_calloc(1, sizeof(struct Mailbox));
+ mutt_str_strfcpy(mailbox->path, path, sizeof(mailbox->path));
char *r = realpath(path, rp);
- mutt_str_strfcpy(buffy->realpath, r ? rp : path, sizeof(buffy->realpath));
- buffy->magic = 0;
+ mutt_str_strfcpy(mailbox->realpath, r ? rp : path, sizeof(mailbox->realpath));
+ mailbox->magic = 0;
- return buffy;
+ return mailbox;
}
/**
- * buffy_free - Free a Mailbox
+ * mailbox_free - Free a Mailbox
* @param mailbox Mailbox to free
*/
-static void buffy_free(struct Mailbox **mailbox)
+static void mailbox_free(struct Mailbox **mailbox)
{
if (mailbox && *mailbox)
FREE(&(*mailbox)->desc);
}
/**
- * buffy_maildir_check_dir - Check for new mail / mail counts
+ * mailbox_maildir_check_dir - Check for new mail / mail counts
* @param mailbox Mailbox to check
* @param dir_name Path to mailbox
* @param check_new if true, check for new mail
*
* Checks the specified maildir subdir (cur or new) for new mail or mail counts.
*/
-static int buffy_maildir_check_dir(struct Mailbox *mailbox, const char *dir_name,
- bool check_new, bool check_stats)
+static int mailbox_maildir_check_dir(struct Mailbox *mailbox, const char *dir_name,
+ bool check_new, bool check_stats)
{
char path[PATH_MAX];
char msgpath[PATH_MAX];
}
/**
- * buffy_maildir_check - Check for new mail in a maildir mailbox
+ * mailbox_maildir_check - Check for new mail in a maildir mailbox
* @param mailbox Mailbox to check
* @param check_stats if true, also count total, new, and flagged messages
* @retval 1 if the mailbox has new mail
*/
-static int buffy_maildir_check(struct Mailbox *mailbox, bool check_stats)
+static int mailbox_maildir_check(struct Mailbox *mailbox, bool check_stats)
{
int rc = 1;
bool check_new = true;
mailbox->msg_flagged = 0;
}
- rc = buffy_maildir_check_dir(mailbox, "new", check_new, check_stats);
+ rc = mailbox_maildir_check_dir(mailbox, "new", check_new, check_stats);
check_new = !rc && MaildirCheckCur;
if (check_new || check_stats)
- if (buffy_maildir_check_dir(mailbox, "cur", check_new, check_stats))
+ if (mailbox_maildir_check_dir(mailbox, "cur", check_new, check_stats))
rc = 1;
return rc;
}
/**
- * buffy_mbox_check - Check for new mail for an mbox mailbox
+ * mailbox_mbox_check - Check for new mail for an mbox mailbox
* @param mailbox Mailbox to check
* @param sb stat(2) information about the mailbox
* @param check_stats if true, also count total, new, and flagged messages
* @retval 1 if the mailbox has new mail
*/
-static int buffy_mbox_check(struct Mailbox *mailbox, struct stat *sb, bool check_stats)
+static int mailbox_mbox_check(struct Mailbox *mailbox, struct stat *sb, bool check_stats)
{
int rc = 0;
int new_or_changed;
}
/**
- * buffy_check - Check a mailbox for new mail
+ * mailbox_check - Check a mailbox for new mail
* @param tmp Mailbox to check
* @param contex_sb stat() info for the current mailbox (Context)
* @param check_stats If true, also count the total, new and flagged messages
*/
-static void buffy_check(struct Mailbox *tmp, struct stat *contex_sb, bool check_stats)
+static void mailbox_check(struct Mailbox *tmp, struct stat *contex_sb, bool check_stats)
{
struct stat sb;
#ifdef USE_SIDEBAR
{
case MUTT_MBOX:
case MUTT_MMDF:
- if (buffy_mbox_check(tmp, &sb, check_stats) > 0)
+ if (mailbox_mbox_check(tmp, &sb, check_stats) > 0)
MailboxCount++;
break;
case MUTT_MAILDIR:
- if (buffy_maildir_check(tmp, check_stats) > 0)
+ if (mailbox_maildir_check(tmp, check_stats) > 0)
MailboxCount++;
break;
case MUTT_MH:
- if (mh_buffy(tmp, check_stats))
+ if (mh_mailbox(tmp, check_stats))
MailboxCount++;
break;
#ifdef USE_NOTMUCH
}
/**
- * buffy_get - Fetch buffy object for given path, if present
+ * mailbox_get - Fetch mailbox object for given path, if present
* @param path Path to the mailbox
* @retval ptr Mailbox for the path
*/
-static struct Mailbox *buffy_get(const char *path)
+static struct Mailbox *mailbox_get(const char *path)
{
if (!path)
return NULL;
}
/**
- * mutt_buffy_cleanup - Restore the timestamp of a mailbox
+ * mutt_mailbox_cleanup - Restore the timestamp of a mailbox
* @param path Path to the mailbox
* @param st Timestamp info from stat()
*
* Fix up the atime and mtime after mbox/mmdf mailbox was modified according to
* stat() info taken before a modification.
*/
-void mutt_buffy_cleanup(const char *path, struct stat *st)
+void mutt_mailbox_cleanup(const char *path, struct stat *st)
{
struct utimbuf ut;
}
else
{
- /* fix up the times so buffy won't get confused */
+ /* fix up the times so mailbox won't get confused */
if (st->st_mtime > st->st_atime)
{
ut.actime = st->st_atime;
continue;
}
- struct Mailbox *b = buffy_new(buf);
+ struct Mailbox *b = mailbox_new(buf);
b->new = false;
b->notified = true;
mutt_sb_notify_mailbox(np->b, 0);
#endif
STAILQ_REMOVE(&AllMailboxes, np, MailboxNode, entries);
- buffy_free(&np->b);
+ mailbox_free(&np->b);
FREE(&np);
continue;
}
}
/**
- * mutt_buffy_check - Check all AllMailboxes for new mail
+ * mutt_mailbox_check - Check all AllMailboxes for new mail
* @param force Force flags, see below
* @retval num Number of mailboxes with new mail
*
*
* Check all AllMailboxes for new mail and total/new/flagged messages
*/
-int mutt_buffy_check(int force)
+int mutt_mailbox_check(int force)
{
struct stat contex_sb;
time_t t;
MailboxNotify = 0;
#ifdef USE_IMAP
- MailboxCount += imap_buffy_check(check_stats);
+ MailboxCount += imap_mailbox_check(check_stats);
#endif
/* check device ID and serial number instead of comparing paths */
struct MailboxNode *np = NULL;
STAILQ_FOREACH(np, &AllMailboxes, entries)
{
- buffy_check(np->b, &contex_sb, check_stats);
+ mailbox_check(np->b, &contex_sb, check_stats);
}
return MailboxCount;
}
/**
- * mutt_buffy_list - List the mailboxes with new mail
+ * mutt_mailbox_list - List the mailboxes with new mail
* @retval true If there is new mail
*/
-bool mutt_buffy_list(void)
+bool mutt_mailbox_list(void)
{
char path[PATH_MAX];
- char buffylist[2 * STRING];
+ char mailboxlist[2 * STRING];
size_t pos = 0;
int first = 1;
int have_unnotified = MailboxNotify;
- buffylist[0] = '\0';
- pos += strlen(strncat(buffylist, _("New mail in "), sizeof(buffylist) - 1 - pos));
+ mailboxlist[0] = '\0';
+ pos += strlen(strncat(mailboxlist, _("New mail in "), sizeof(mailboxlist) - 1 - pos));
struct MailboxNode *np = NULL;
STAILQ_FOREACH(np, &AllMailboxes, entries)
{
}
if (!first)
- pos += strlen(strncat(buffylist + pos, ", ", sizeof(buffylist) - 1 - pos));
+ pos += strlen(strncat(mailboxlist + pos, ", ", sizeof(mailboxlist) - 1 - pos));
/* Prepend an asterisk to mailboxes not already notified */
if (!np->b->notified)
{
- /* pos += strlen (strncat(buffylist + pos, "*", sizeof(buffylist)-1-pos)); */
+ /* pos += strlen (strncat(mailboxlist + pos, "*", sizeof(mailboxlist)-1-pos)); */
np->b->notified = true;
MailboxNotify--;
}
- pos += strlen(strncat(buffylist + pos, path, sizeof(buffylist) - 1 - pos));
+ pos += strlen(strncat(mailboxlist + pos, path, sizeof(mailboxlist) - 1 - pos));
first = 0;
}
if (!first && np)
{
- strncat(buffylist + pos, ", ...", sizeof(buffylist) - 1 - pos);
+ strncat(mailboxlist + pos, ", ...", sizeof(mailboxlist) - 1 - pos);
}
if (!first)
{
- mutt_message("%s", buffylist);
+ mutt_message("%s", mailboxlist);
return true;
}
/* there were no mailboxes needing to be notified, so clean up since
}
/**
- * mutt_buffy_setnotified - Note when the user was last notified of new mail
+ * mutt_mailbox_setnotified - Note when the user was last notified of new mail
* @param path Path to the mailbox
*/
-void mutt_buffy_setnotified(const char *path)
+void mutt_mailbox_setnotified(const char *path)
{
- struct Mailbox *buffy = buffy_get(path);
- if (!buffy)
+ struct Mailbox *mailbox = mailbox_get(path);
+ if (!mailbox)
return;
- buffy->notified = true;
- time(&buffy->last_visited);
+ mailbox->notified = true;
+ time(&mailbox->last_visited);
}
/**
- * mutt_buffy_notify - Notify the user if there's new mail
+ * mutt_mailbox_notify - Notify the user if there's new mail
* @retval true If there is new mail
*/
-bool mutt_buffy_notify(void)
+bool mutt_mailbox_notify(void)
{
- if (mutt_buffy_check(0) && MailboxNotify)
+ if (mutt_mailbox_check(0) && MailboxNotify)
{
- return mutt_buffy_list();
+ return mutt_mailbox_list();
}
return false;
}
/**
- * mutt_buffy - incoming folders completion routine
+ * mutt_mailbox - incoming folders completion routine
* @param s Buffer containing name of current mailbox
* @param slen Buffer length
*
* Given a folder name, find the next incoming folder with new mail.
*/
-void mutt_buffy(char *s, size_t slen)
+void mutt_mailbox(char *s, size_t slen)
{
mutt_expand_path(s, slen);
- if (mutt_buffy_check(0))
+ if (mutt_mailbox_check(0))
{
int found = 0;
for (int pass = 0; pass < 2; pass++)
}
}
- mutt_buffy_check(MUTT_MAILBOX_CHECK_FORCE); /* buffy was wrong - resync things */
+ mutt_mailbox_check(MUTT_MAILBOX_CHECK_FORCE); /* mailbox was wrong - resync things */
}
/* no folders with new mail */
#ifdef USE_NOTMUCH
/**
- * mutt_buffy_vfolder - Find the first virtual folder with new mail
+ * mutt_mailbox_vfolder - Find the first virtual folder with new mail
* @param buf Buffer for the folder name
* @param buflen Length of the buffer
*/
-void mutt_buffy_vfolder(char *buf, size_t buflen)
+void mutt_mailbox_vfolder(char *buf, size_t buflen)
{
- if (mutt_buffy_check(0))
+ if (mutt_mailbox_check(0))
{
bool found = false;
for (int pass = 0; pass < 2; pass++)
}
}
- mutt_buffy_check(MUTT_MAILBOX_CHECK_FORCE); /* Mailbox was wrong - resync things */
+ mutt_mailbox_check(MUTT_MAILBOX_CHECK_FORCE); /* Mailbox was wrong - resync things */
}
/* no folders with new mail */
extern struct MailboxList AllMailboxes;
#ifdef USE_NOTMUCH
-void mutt_buffy_vfolder(char *buf, size_t buflen);
+void mutt_mailbox_vfolder(char *buf, size_t buflen);
#endif
struct Mailbox *mutt_find_mailbox(const char *path);
void mutt_update_mailbox(struct Mailbox *b);
-void mutt_buffy_cleanup(const char *path, struct stat *st);
+void mutt_mailbox_cleanup(const char *path, struct stat *st);
/** mark mailbox just left as already notified */
-void mutt_buffy_setnotified(const char *path);
+void mutt_mailbox_setnotified(const char *path);
-/* force flags passed to mutt_buffy_check() */
+/* force flags passed to mutt_mailbox_check() */
#define MUTT_MAILBOX_CHECK_FORCE (1 << 0)
#define MUTT_MAILBOX_CHECK_FORCE_STATS (1 << 1)
-void mutt_buffy(char *s, size_t slen);
-bool mutt_buffy_list(void);
-int mutt_buffy_check(int force);
-bool mutt_buffy_notify(void);
+void mutt_mailbox(char *s, size_t slen);
+bool mutt_mailbox_list(void);
+int mutt_mailbox_check(int force);
+bool mutt_mailbox_notify(void);
int mutt_parse_mailboxes(struct Buffer *path, struct Buffer *s, unsigned long data, struct Buffer *err);
int mutt_parse_unmailboxes(struct Buffer *path, struct Buffer *s, unsigned long data, struct Buffer *err);
struct Header *maildir_parse_stream(int magic, FILE *f, const char *fname, bool is_old, struct Header *h);
bool maildir_update_flags(struct Context *ctx, struct Header *o, struct Header *n);
-bool mh_buffy(struct Mailbox *mailbox, bool check_stats);
+bool mh_mailbox(struct Mailbox *mailbox, bool check_stats);
int mh_check_empty(const char *path);
bool mx_is_maildir(const char *path);
}
/**
- * mh_buffy - Check for new mail for a mh mailbox
+ * mh_mailbox - Check for new mail for a mh mailbox
* @param mailbox Mailbox to check
* @param check_stats Also count total, new, and flagged messages
* @retval true if the mailbox has new mail
*/
-bool mh_buffy(struct Mailbox *mailbox, bool check_stats)
+bool mh_mailbox(struct Mailbox *mailbox, bool check_stats)
{
struct MhSequences mhs = { 0 };
bool check_new = true;
{
if (flags & MUTT_MAILBOX)
{
- if (mutt_buffy_check(0) == 0)
+ if (mutt_mailbox_check(0) == 0)
{
mutt_message(_("No mailbox with new mail."));
goto main_curses; // TEST37: neomutt -Z (no new mail)
}
folder[0] = '\0';
- mutt_buffy(folder, sizeof(folder));
+ mutt_mailbox(folder, sizeof(folder));
}
else if (flags & MUTT_SELECT)
{
if (Context || !explicit_folder)
{
#ifdef USE_SIDEBAR
- mutt_sb_set_open_buffy();
+ mutt_sb_set_open_mailbox();
#endif
mutt_index_menu();
if (Context)
* @param st Timestamp
*
* if mailbox has at least 1 new message, sets mtime > atime of mailbox so
- * buffy check reports new mail
+ * mailbox check reports new mail
*/
void mbox_reset_atime(struct Context *ctx, struct stat *st)
{
if (!ctx)
return;
- /* fix up the times so buffy won't get confused */
+ /* fix up the times so mailbox won't get confused */
if (ctx->peekonly && ctx->path && (ctx->mtime > ctx->atime))
{
ut.actime = ctx->atime;
/* never announce that a mailbox we've just left has new mail. #3290
* TODO: really belongs in mx_mbox_close, but this is a nice hook point */
if (!ctx->peekonly)
- mutt_buffy_setnotified(ctx->path);
+ mutt_mailbox_setnotified(ctx->path);
if (ctx->mx_ops)
ctx->mx_ops->mbox_close(ctx);
ctx->flagged--;
}
ctx->msgcount -= ctx->deleted;
- mutt_sb_set_buffystats(ctx);
+ mutt_sb_set_mailbox_stats(ctx);
ctx->msgcount = orig_msgcount;
}
#endif
}
/**
- * nntp_buffy - Get first newsgroup with new messages
+ * nntp_mailbox - Get first newsgroup with new messages
* @param buf Buffer for result
* @param len Length of buffer
*/
-void nntp_buffy(char *buf, size_t len)
+void nntp_mailbox(char *buf, size_t len)
{
for (unsigned int i = 0; i < CurrentNewsSrv->groups_num; i++)
{
int nntp_check_children(struct Context *ctx, const char *msgid);
int nntp_newsrc_parse(struct NntpServer *nserv);
void nntp_newsrc_close(struct NntpServer *nserv);
-void nntp_buffy(char *buf, size_t len);
+void nntp_mailbox(char *buf, size_t len);
void nntp_expand_path(char *line, size_t len, struct Account *acct);
void nntp_clear_cache(struct NntpServer *nserv);
const char *nntp_format_str(char *buf, size_t buflen, size_t col, int cols, char op,
*
* @note The window parameter here is here to decide contextually whether we
* want to return a search query with window applied (for the actual search
- * result in buffy) or not (for the count in the sidebar). It is not aimed at
+ * result in mailbox) or not (for the count in the sidebar). It is not aimed at
* enabling/disabling the feature.
*/
static char *get_query_string(struct NmCtxData *data, bool window)
* by building a notmuch context object from the original search string, and
* building a new from the notmuch context object.
*
- * It's aimed to be used by buffy when parsing the virtual_mailboxes to make the
+ * It's aimed to be used by mailbox when parsing the virtual_mailboxes to make the
* parsed user written search strings comparable to the internally generated ones.
*/
bool nm_normalize_uri(char *new_uri, const char *orig_uri, size_t new_uri_sz)
}
/* don't be verbose about connection, as we're called from
- * sidebar/buffy very often */
+ * sidebar/mailbox very often */
db = do_database_open(db_filename, false, false);
if (!db)
goto done;
}
}
- if (mutt_buffy_notify() || do_new_mail)
+ if (mutt_mailbox_notify() || do_new_mail)
{
if (BeepNew)
beep();
break;
case OP_MAILBOX_LIST:
- mutt_buffy_list();
+ mutt_mailbox_list();
break;
case OP_VIEW_ATTACHMENTS:
char tempfile[PATH_MAX];
FILE *tempfp = NULL;
int rc = -1;
- bool need_buffy_cleanup = false;
+ bool need_mailbox_cleanup = false;
struct stat st;
char buf[SHORT_STRING];
int onm_flags;
goto done;
}
/* remember new mail status before appending message */
- need_buffy_cleanup = true;
+ need_mailbox_cleanup = true;
stat(path, &st);
}
mx_msg_close(&f, &msg);
mx_mbox_close(&f, NULL);
- if (!post && need_buffy_cleanup)
- mutt_buffy_cleanup(path, &st);
+ if (!post && need_mailbox_cleanup)
+ mutt_mailbox_cleanup(path, &st);
if (post)
set_noconv_flags(hdr->content, 0);
*/
struct SbEntry
{
- char box[STRING]; /**< formatted mailbox name */
- struct Mailbox *buffy; /**< Mailbox this represents */
- bool is_hidden; /**< Don't show, e.g. $sidebar_new_mail_only */
+ char box[STRING]; /**< formatted mailbox name */
+ struct Mailbox *mailbox; /**< Mailbox this represents */
+ bool is_hidden; /**< Don't show, e.g. $sidebar_new_mail_only */
};
static int EntryCount = 0;
buf[0] = 0; /* Just in case there's nothing to do */
- struct Mailbox *b = sbe->buffy;
+ struct Mailbox *b = sbe->mailbox;
if (!b)
return src;
{
const struct SbEntry *sbe1 = *(const struct SbEntry **) a;
const struct SbEntry *sbe2 = *(const struct SbEntry **) b;
- struct Mailbox *b1 = sbe1->buffy;
- struct Mailbox *b2 = sbe2->buffy;
+ struct Mailbox *b1 = sbe1->mailbox;
+ struct Mailbox *b2 = sbe2->mailbox;
int result = 0;
sbe->is_hidden = false;
#ifdef USE_NOTMUCH
- if (((sbe->buffy->magic != MUTT_NOTMUCH) && (sidebar_source == SB_SRC_VIRT)) ||
- ((sbe->buffy->magic == MUTT_NOTMUCH) && (sidebar_source == SB_SRC_INCOMING)))
+ if (((sbe->mailbox->magic != MUTT_NOTMUCH) && (sidebar_source == SB_SRC_VIRT)) ||
+ ((sbe->mailbox->magic == MUTT_NOTMUCH) && (sidebar_source == SB_SRC_INCOMING)))
{
sbe->is_hidden = true;
continue;
if (!new_only)
continue;
- if ((i == OpnIndex) || (sbe->buffy->msg_unread > 0) || sbe->buffy->new ||
- (sbe->buffy->msg_flagged > 0))
+ if ((i == OpnIndex) || (sbe->mailbox->msg_unread > 0) ||
+ sbe->mailbox->new || (sbe->mailbox->msg_flagged > 0))
{
continue;
}
- if (Context && (mutt_str_strcmp(sbe->buffy->realpath, Context->realpath) == 0))
+ if (Context && (mutt_str_strcmp(sbe->mailbox->realpath, Context->realpath) == 0))
{
/* Spool directory */
continue;
}
- if (mutt_list_find(&SidebarWhitelist, sbe->buffy->path) ||
- mutt_list_find(&SidebarWhitelist, sbe->buffy->desc))
+ if (mutt_list_find(&SidebarWhitelist, sbe->mailbox->path) ||
+ mutt_list_find(&SidebarWhitelist, sbe->mailbox->desc))
{
/* Explicitly asked to be visible */
continue;
break;
int j = i;
- while ((j < EntryCount) && (Entries[j]->buffy != np->b))
+ while ((j < EntryCount) && (Entries[j]->mailbox != np->b))
j++;
if (j < EntryCount)
{
}
if (entry == HilIndex)
return false;
- } while (!Entries[entry]->buffy->new && !Entries[entry]->buffy->msg_unread);
+ } while (!Entries[entry]->mailbox->new && !Entries[entry]->mailbox->msg_unread);
HilIndex = entry;
return true;
}
if (entry == HilIndex)
return false;
- } while (!Entries[entry]->buffy->new && !Entries[entry]->buffy->msg_unread);
+ } while (!Entries[entry]->mailbox->new && !Entries[entry]->mailbox->msg_unread);
HilIndex = entry;
return true;
entry = Entries[entryidx];
if (entry->is_hidden)
continue;
- b = entry->buffy;
+ b = entry->mailbox;
if (entryidx == OpnIndex)
{
}
/**
- * mutt_sb_set_buffystats - Update the Mailbox's message counts from the Context
+ * mutt_sb_set_mailbox_stats - Update the Mailbox's message counts from the Context
* @param ctx A mailbox Context
*
* Given a mailbox Context, find a matching mailbox Mailbox and copy the message
* counts into it.
*/
-void mutt_sb_set_buffystats(const struct Context *ctx)
+void mutt_sb_set_mailbox_stats(const struct Context *ctx)
{
if (!ctx)
return;
if (!EntryCount || HilIndex < 0)
return NULL;
- return Entries[HilIndex]->buffy->path;
+ return Entries[HilIndex]->mailbox->path;
}
/**
- * mutt_sb_set_open_buffy - Set the OpnMailbox based on the global Context
+ * mutt_sb_set_open_mailbox - Set the OpnMailbox based on the global Context
*
* Search through the list of mailboxes. If a Mailbox has a matching path, set
* OpnMailbox to it.
*/
-void mutt_sb_set_open_buffy(void)
+void mutt_sb_set_open_mailbox(void)
{
OpnIndex = -1;
for (int entry = 0; entry < EntryCount; entry++)
{
- if (mutt_str_strcmp(Entries[entry]->buffy->realpath, Context->realpath) == 0)
+ if (mutt_str_strcmp(Entries[entry]->mailbox->realpath, Context->realpath) == 0)
{
OpnIndex = entry;
HilIndex = entry;
mutt_mem_realloc(&Entries, EntryLen * sizeof(struct SbEntry *));
}
Entries[EntryCount] = mutt_mem_calloc(1, sizeof(struct SbEntry));
- Entries[EntryCount]->buffy = b;
+ Entries[EntryCount]->mailbox = b;
if (TopIndex < 0)
TopIndex = EntryCount;
{
int del_index;
for (del_index = 0; del_index < EntryCount; del_index++)
- if (Entries[del_index]->buffy == b)
+ if (Entries[del_index]->mailbox == b)
break;
if (del_index == EntryCount)
return;
void mutt_sb_draw(void);
const char *mutt_sb_get_highlight(void);
void mutt_sb_notify_mailbox(struct Mailbox *b, int created);
-void mutt_sb_set_buffystats(const struct Context *ctx);
-void mutt_sb_set_open_buffy(void);
+void mutt_sb_set_mailbox_stats(const struct Context *ctx);
+void mutt_sb_set_open_mailbox(void);
void mutt_sb_toggle_virtual(void);
#endif /* _MUTT_SIDEBAR_H */
if (!optional)
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
- snprintf(buf, buflen, fmt, mutt_buffy_check(0));
+ snprintf(buf, buflen, fmt, mutt_mailbox_check(0));
}
- else if (mutt_buffy_check(0) == 0)
+ else if (mutt_mailbox_check(0) == 0)
optional = 0;
break;