NNTP_DATA *data;
NNTP_SERVER *news = CurrentNewsSrv;
-/* mutt_buffy_check (0); */
+/* buffy_check (0); */
init_state (state, menu);
for (tmp = news->list; tmp; tmp = tmp->next) {
return (-1);
}
- mutt_buffy_check (0);
+ buffy_check (0);
if ((dp = opendir (d)) == NULL) {
mutt_perror (d);
NNTP_DATA *data;
NNTP_SERVER *news = CurrentNewsSrv;
-/* mutt_buffy_check (0); */
+/* buffy_check (0); */
init_state (state, menu);
for (tmp = news->list; tmp; tmp = tmp->next) {
if (!Incoming)
return (-1);
- mutt_buffy_check (0);
+ buffy_check (0);
init_state (state, menu);
else
#endif
if (buffy)
- snprintf (title, titlelen, _("Mailboxes [%d]"), mutt_buffy_check (0));
+ snprintf (title, titlelen, _("Mailboxes [%d]"), buffy_check (0));
else {
strfcpy (path, LastDir, sizeof (path));
mutt_pretty_mailbox (path);
break;
case OP_BUFFY_LIST:
- mutt_buffy_list ();
+ buffy_list ();
break;
case OP_BROWSER_NEW_FILE:
/* Find the last message in the file.
* upon success return 0. If no message found - return -1 */
-int fseek_last_message (FILE * f)
+static int fseek_last_message (FILE * f)
{
long int pos;
char buffer[BUFSIZ + 9]; /* 7 for "\n\nFrom " */
}
/* Return 1 if the last message is new */
-int test_last_status_new (FILE * f)
+static int test_last_status_new (FILE * f)
{
HEADER *hdr;
ENVELOPE *tmp_envelope;
return result;
}
-int test_new_folder (const char *path)
+static int test_new_folder (const char *path)
{
FILE *f;
int rc = 0;
return rc;
}
-BUFFY *mutt_find_mailbox (const char *path)
+BUFFY *buffy_find_mailbox (const char *path)
{
struct stat sb;
struct stat tmp_sb;
return (NULL);
}
-void mutt_update_mailbox (BUFFY * b)
+void buffy_update_mailbox (BUFFY * b)
{
struct stat sb;
return (-1);
}
-int mutt_parse_mailboxes (BUFFER * path, BUFFER * s, unsigned long data,
+int buffy_parse_mailboxes (BUFFER * path, BUFFER * s, unsigned long data,
BUFFER * err)
{
BUFFY* tmp;
* 1 force all checks + update sidebar
* 2 force all checks + _don't_ update sidebar
*/
-int mutt_buffy_check (int force)
+int buffy_check (int force)
{
BUFFY *tmp;
struct stat sb;
/* sidebar visible */
BuffyCount++;
if ((ctx =
- mx_open_mailbox (tmp->path, M_READONLY | M_QUIET | M_NOSORT,
+ mx_open_mailbox (tmp->path, M_READONLY | M_QUIET | M_NOSORT | M_COUNT,
NULL)) != NULL) {
tmp->msgcount = ctx->msgcount;
tmp->new = ctx->new;
return (BuffyCount);
}
-int mutt_buffy_list (void)
+int buffy_list (void)
{
BUFFY *tmp;
char path[_POSIX_PATH_MAX];
int i = 0;
if (option (OPTFORCEBUFFYCHECK))
- mutt_buffy_check (1);
+ buffy_check (1);
pos = 0;
first = 1;
return (0);
}
-int mutt_buffy_notify (void)
+int buffy_notify (void)
{
- if (mutt_buffy_check (0) && BuffyNotify) {
- return (mutt_buffy_list ());
+ if (buffy_check (0) && BuffyNotify) {
+ return (buffy_list ());
}
return (0);
}
* given a folder name, this routine gives the next incoming folder with new
* new mail.
*/
-void mutt_buffy (char *s, size_t slen)
+void buffy_next (char *s, size_t slen)
{
int i = 0, c = 0;
return;
mutt_expand_path (s, _POSIX_PATH_MAX);
- if (mutt_buffy_check (0) == 0) {
+ if (buffy_check (0) == 0) {
*s = '\0';
return;
}
}
if (c == i) {
*s = '\0';
- /* something went wrong since we're here when mutt_buffy_check
+ /* something went wrong since we're here when buffy_check
* reported new mail */
- mutt_buffy_check (0);
+ buffy_check (0);
} else {
strfcpy (s, ((BUFFY*) Incoming->data[c])->path, slen);
mutt_pretty_mailbox (s);
short newly_created; /* mbox or mmdf just popped into existence */
} BUFFY;
+/* folders with incomming mail (via mailboxes command) */
WHERE list2_t* Incoming;
WHERE short BuffyTimeout INITVAL (3);
+extern time_t BuffyDoneTime; /* last time we knew for sure how much mail there was */
-/*
- * looks up a path in Incoming list
- * there needs to be an extra function since we have everything but
- * object of type BUFFY when we want to a do a lookup ;-(
- */
+/* looks up a path in Incoming list (returns index) */
int buffy_lookup (const char*);
-
-extern time_t BuffyDoneTime; /* last time we knew for sure how much mail there was */
+/* handles mailboxes commands */
+int buffy_parse_mailboxes (BUFFER*, BUFFER*, unsigned long, BUFFER*);
+/* from given path, gets next mailbox in Incoming with new mail */
+void buffy_next (char*, size_t);
+/* checks mailboxes for new mail (returns number) */
+int buffy_check (int);
+/* lists mailboxes with new mail */
+int buffy_list (void);
+/* wrapper around buffy_list() */
+int buffy_notify (void);
#ifdef BUFFY_SIZE
-BUFFY *mutt_find_mailbox (const char *path);
-void mutt_update_mailbox (BUFFY * b);
+BUFFY *buffy_find_mailbox (const char *path);
+void buffy_update_mailbox (BUFFY * b);
#endif
#endif /* !_BUFFY_H */
#ifdef BUFFY_SIZE
tmp = mutt_find_mailbox (buf);
if (tmp && tmp->new <= 0)
- mutt_update_mailbox (tmp);
+ buffy_update_mailbox (tmp);
#else
/* fix up the times so buffy won't get confused */
if (st.st_mtime > st.st_atime) {
#include "sort.h"
#include "charset.h"
#include "mx.h"
+#include "buffy.h"
#include "compose.h"
#ifdef MIXMASTER
ComposeHelp);
if (option (OPTMBOXPANE))
- mutt_buffy_check (1);
+ buffy_check (1);
while (loop) {
#ifdef USE_NNTP
unset_option (OPTNEWS); /* for any case */
IndexHelp);
if (!attach_msg) {
- mutt_buffy_check (1); /* force the buffy check after we enter the folder */
+ buffy_check (1); /* force the buffy check after we enter the folder */
/* record folder we open to place sidebar indicator properly */
if (Context && Context->path)
sidebar_set_current (Context->path);
if (!attach_msg) {
/* check for new mail in the incoming folders */
oldcount = newcount;
- if ((newcount = mutt_buffy_check (0)) != oldcount) {
+ if ((newcount = buffy_check (0)) != oldcount) {
menu->redraw |= REDRAW_STATUS;
menu->redraw |= REDRAW_SIDEBAR;
}
if (do_buffy_notify) {
- if (mutt_buffy_notify () && option (OPTBEEPNEW))
+ if (buffy_notify () && option (OPTBEEPNEW))
beep ();
}
else
{
if (Context && Context->path)
strncpy (buf, Context->path, sizeof (buf));
- mutt_buffy (buf, sizeof (buf));
+ buffy_next (buf, sizeof (buf));
}
if (op == OP_SIDEBAR_OPEN) {
menu->current = 0;
#ifdef USE_NNTP
- /* mutt_buffy_check() must be done with mail-reader mode! */
+ /* buffy_check() must be done with mail-reader mode! */
menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_MAIN,
(Context
&& (Context->magic ==
IndexHelp);
#endif
mutt_clear_error ();
- mutt_buffy_check (1); /* force the buffy check after we have changed
+ buffy_check (1); /* force the buffy check after we have changed
the folder */
menu->redraw = REDRAW_FULL;
set_option (OPTSEARCHINVALID);
break;
case OP_BUFFY_LIST:
- mutt_buffy_list ();
+ buffy_list ();
menu->redraw = REDRAW_FULL;
break;
#include "mutt_curses.h"
#include "keymap.h"
#include "history.h"
+#include "buffy.h"
#include "lib/mem.h"
if (flags & M_EFILE) {
first = 1; /* clear input if user types a real key later */
my_wcstombs (buf, buflen, state->wbuf, state->curpos);
- mutt_buffy (buf, buflen);
+ buffy_next (buf, buflen);
state->curpos = state->lastchar =
my_mbstowcs (&state->wbuf, &state->wbuflen, 0, buf);
break;
fmt->mx_access = imap_access;
fmt->mx_open_mailbox = imap_open_mailbox;
fmt->mx_acl_check = acl_check_imap;
+ fmt->mx_fastclose_mailbox = imap_close_mailbox;
+ fmt->mx_sync_mailbox = imap_sync_mailbox;
return (fmt);
}
{"ignore", parse_ignore, 0},
{"lists", parse_lists, 0},
{"macro", mutt_parse_macro, 0},
- {"mailboxes", mutt_parse_mailboxes, M_MAILBOXES},
- {"unmailboxes", mutt_parse_mailboxes, M_UNMAILBOXES},
+ {"mailboxes", buffy_parse_mailboxes, M_MAILBOXES},
+ {"unmailboxes", buffy_parse_mailboxes, M_UNMAILBOXES},
{"message-hook", mutt_parse_hook, M_MESSAGEHOOK},
{"mbox-hook", mutt_parse_hook, M_MBOXHOOK},
{"mime_lookup", parse_list, UL &MimeLookupList},
}
else {
if (flags & M_BUFFY) {
- if (!mutt_buffy_check (0)) {
+ if (!buffy_check (0)) {
mutt_endwin _("No mailbox with new mail.");
exit (1);
}
folder[0] = 0;
- mutt_buffy (folder, sizeof (folder));
+ buffy_next (folder, sizeof (folder));
}
else if (flags & M_SELECT) {
#ifdef USE_NNTP
#include "mutt.h"
#include "mx.h"
+#include "buffy.h"
#include "mbox.h"
#include "sort.h"
#include "copy.h"
return 0;
}
+/* prototypes */
+static int mbox_reopen_mailbox (CONTEXT*, int*);
+
/* parameters:
* ctx - context to lock
* excl - exclusive lock?
}
}
-int mmdf_parse_mailbox (CONTEXT * ctx)
+static int mmdf_parse_mailbox (CONTEXT * ctx)
{
char buf[HUGE_STRING];
char return_path[LONG_STRING];
* NOTE: it is assumed that the mailbox being read has been locked before
* this routine gets called. Strange things could happen if it's not!
*/
-int mbox_parse_mailbox (CONTEXT * ctx)
+static int mbox_parse_mailbox (CONTEXT * ctx)
{
struct stat sb;
char buf[HUGE_STRING], return_path[STRING];
#undef PREV
/* open a mbox or mmdf style mailbox */
-int mbox_open_mailbox (CONTEXT * ctx)
+static int mbox_open_mailbox (CONTEXT * ctx)
{
int rc;
* 0 success
* -1 failure
*/
-int mbox_sync_mailbox (CONTEXT * ctx, int *index_hint)
+static int _mbox_sync_mailbox (CONTEXT * ctx, int unused, int *index_hint)
{
char tempfile[_POSIX_PATH_MAX];
char buf[32];
mutt_error
_("sync: mbox modified, but no modified messages! (report this bug)");
mutt_sleep (5); /* the mutt_error /will/ get cleared! */
- dprint (1, (debugfile, "mbox_sync_mailbox(): no modified messages.\n"));
+ dprint (1, (debugfile, "_mbox_sync_mailbox(): no modified messages.\n"));
unlink (tempfile);
goto bail;
}
if (fclose (fp) != 0) {
fp = NULL;
dprint (1,
- (debugfile, "mbox_sync_mailbox: fclose() returned non-zero.\n"));
+ (debugfile, "_mbox_sync_mailbox: fclose() returned non-zero.\n"));
unlink (tempfile);
mutt_perror (tempfile);
mutt_sleep (5);
mx_fastclose_mailbox (ctx);
dprint (1,
(debugfile,
- "mbox_sync_mailbox: unable to reopen temp copy of mailbox!\n"));
+ "_mbox_sync_mailbox: unable to reopen temp copy of mailbox!\n"));
mutt_perror (tempfile);
mutt_sleep (5);
return (-1);
(ctx->magic == M_MMDF && safe_strcmp (MMDF_SEP, buf) != 0)) {
dprint (1,
(debugfile,
- "mbox_sync_mailbox: message not in expected position."));
+ "_mbox_sync_mailbox: message not in expected position."));
dprint (1, (debugfile, "\tLINE: %s\n", buf));
i = -1;
}
else {
if (fseek (ctx->fp, offset, SEEK_SET) != 0) { /* return to proper offset */
i = -1;
- dprint (1, (debugfile, "mbox_sync_mailbox: fseek() failed\n"));
+ dprint (1, (debugfile, "_mbox_sync_mailbox: fseek() failed\n"));
}
else {
/* copy the temp mailbox back into place starting at the first
return rc;
}
+static int mbox_sync_mailbox (CONTEXT * ctx, int unused, int *index_hint) {
+#ifdef BUFFY_SIZE
+ BUFFY* tmp = NULL;
+#endif
+ int rc = _mbox_sync_mailbox (ctx, unused, index_hint);
+
+#ifdef BUFFY_SIZE
+ if ((tmp = buffy_find_mailbox (ctx->path)) && tmp->new == 0)
+ buffy_update_mailbox (tmp);
+#endif
+ return (rc);
+}
+
/* close a mailbox opened in write-mode */
int mbox_close_mailbox (CONTEXT * ctx)
{
return 0;
}
-int mbox_reopen_mailbox (CONTEXT * ctx, int *index_hint)
+static int mbox_reopen_mailbox (CONTEXT * ctx, int *index_hint)
{
int (*cmp_headers) (const HEADER *, const HEADER *) = NULL;
HEADER **old_hdrs;
fmt->mx_is_magic = mbox_is_magic;
fmt->mx_access = access;
fmt->mx_open_mailbox = mbox_open_mailbox;
+ fmt->mx_sync_mailbox = mbox_sync_mailbox;
return (fmt);
}
#include "mx.h"
+/* TODO all of these must disappear to achieve good information hiding */
+
#define MMDF_SEP "\001\001\001\001\n"
-int mbox_sync_mailbox (CONTEXT *, int *);
-int mbox_open_mailbox (CONTEXT *);
int mbox_check_mailbox (CONTEXT *, int *);
int mbox_close_mailbox (CONTEXT *);
int mbox_lock_mailbox (CONTEXT *, int, int);
-int mbox_parse_mailbox (CONTEXT *);
-int mmdf_parse_mailbox (CONTEXT *);
void mbox_unlock_mailbox (CONTEXT *);
int mbox_check_empty (const char *);
-/* this is still here for compressed folders support... */
int mbox_is_magic (const char*, struct stat*);
-
int mbox_strict_cmp_headers (const HEADER *, const HEADER *);
-int mbox_reopen_mailbox (CONTEXT *, int *);
-
int mbox_open_new_message (MESSAGE * msg, CONTEXT * dest, HEADER * hdr);
mx_t* mbox_reg_mx (void);
#define MH_SEQ_REPLIED (1 << 1)
#define MH_SEQ_FLAGGED (1 << 2)
+/* prototypes */
+static int maildir_check_empty (const char*);
+
static void mhs_alloc (struct mh_sequences *mhs, int i)
{
int j;
return 0;
}
-int mh_read_dir (CONTEXT* ctx) {
+static int mh_read_dir (CONTEXT* ctx) {
return (_mh_read_dir (ctx, NULL));
}
/* read a maildir style mailbox */
-int maildir_read_dir (CONTEXT * ctx)
+static int maildir_read_dir (CONTEXT * ctx)
{
/* maildir looks sort of like MH, except that there are two subdirectories
* of the main folder path from which to read messages
return (0);
}
-int mh_sync_mailbox (CONTEXT * ctx, int *index_hint)
+static int mh_sync_mailbox (CONTEXT * ctx, int unused, int *index_hint)
{
char path[_POSIX_PATH_MAX], tmp[_POSIX_PATH_MAX];
int i, j;
* 0 if there are messages in the mailbox
* -1 on error
*/
-int maildir_check_empty (const char *path)
+static int maildir_check_empty (const char *path)
{
DIR *dp;
struct dirent *de;
mx_t* fmt = safe_calloc (1, sizeof (mx_t));
fmt->local = 1;
fmt->mx_access = access;
+ fmt->mx_sync_mailbox = mh_sync_mailbox;
return (fmt);
}
#include "mx.h"
-int mh_read_dir (CONTEXT *);
-int mh_sync_mailbox (CONTEXT *, int *);
+/* TODO all of these must disappear to achieve good information hiding */
+
int mh_check_mailbox (CONTEXT *, int *);
int mh_buffy (const char *);
-int mh_check_empty (const char *);
int mh_commit_message (CONTEXT *, MESSAGE *, HEADER *);
int mh_open_new_message (MESSAGE *, CONTEXT *, HEADER *);
-int maildir_read_dir (CONTEXT *);
int maildir_check_mailbox (CONTEXT *, int *);
-int maildir_check_empty (const char *);
int maildir_commit_message (CONTEXT *, MESSAGE *, HEADER *);
int maildir_open_new_message (MESSAGE *, CONTEXT *, HEADER *);
FILE *maildir_open_find_message (const char *, const char *);
unsigned int quiet:1; /* inhibit status messages? */
unsigned int collapsed:1; /* are all threads collapsed? */
unsigned int closing:1; /* mailbox is being closed */
+ unsigned int counting:1; /* do we just want to cound? */
} CONTEXT;
typedef struct attachptr {
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
-#ifndef BUFFY_SIZE
#include <utime.h>
-#endif
static list2_t* MailboxFormats = NULL;
#define MX_COMMAND(idx,cmd) ((mx_t*) MailboxFormats->data[idx])->cmd
ctx->quiet = 1;
if (flags & M_READONLY)
ctx->readonly = 1;
+ if (flags & M_COUNT)
+ ctx->counting = 1;
if (flags & (M_APPEND | M_NEWFOLDER)) {
if (mx_open_mailbox_append (ctx, flags) != 0) {
if (!ctx)
return;
-#ifdef USE_IMAP
- if (ctx->magic == M_IMAP)
- imap_close_mailbox (ctx);
-#endif /* USE_IMAP */
-#ifdef USE_POP
- if (ctx->magic == M_POP)
- pop_close_mailbox (ctx);
-#endif /* USE_POP */
-#ifdef USE_NNTP
- if (ctx->magic == M_NNTP)
- nntp_fastclose_mailbox (ctx);
-#endif /* USE_NNTP */
+ if (MX_IDX(ctx->magic-1) && MX_COMMAND(ctx->magic-1,mx_fastclose_mailbox))
+ MX_COMMAND(ctx->magic-1,mx_fastclose_mailbox(ctx));
if (ctx->subj_hash)
hash_destroy (&ctx->subj_hash, NULL);
if (ctx->id_hash)
/* save changes to disk */
static int sync_mailbox (CONTEXT * ctx, int *index_hint)
{
-#ifdef BUFFY_SIZE
- BUFFY *tmp = NULL;
-#endif
int rc = -1;
if (!ctx->quiet)
mutt_message (_("Writing %s..."), ctx->path);
- switch (ctx->magic) {
- case M_MBOX:
- case M_MMDF:
- rc = mbox_sync_mailbox (ctx, index_hint);
-#ifdef BUFFY_SIZE
- tmp = mutt_find_mailbox (ctx->path);
-#endif
- break;
-
- case M_MH:
- case M_MAILDIR:
- rc = mh_sync_mailbox (ctx, index_hint);
- break;
-
-#ifdef USE_IMAP
- case M_IMAP:
- /* extra argument means EXPUNGE */
- rc = imap_sync_mailbox (ctx, 1, index_hint);
- break;
-#endif /* USE_IMAP */
-
-#ifdef USE_POP
- case M_POP:
- rc = pop_sync_mailbox (ctx, index_hint);
- break;
-#endif /* USE_POP */
-
-#ifdef USE_NNTP
- case M_NNTP:
- rc = nntp_sync_mailbox (ctx);
- break;
-#endif /* USE_NNTP */
- }
-
-#if 0
- if (!ctx->quiet && !ctx->shutup && rc == -1)
- mutt_error (_("Could not synchronize mailbox %s!"), ctx->path);
-#endif
-
-#ifdef BUFFY_SIZE
- if (tmp && tmp->new == 0)
- mutt_update_mailbox (tmp);
-#endif
+ if (MX_IDX(ctx->magic-1))
+ /* the 1 is only of interest for IMAP and means EXPUNGE */
+ rc = MX_COMMAND(ctx->magic-1,mx_sync_mailbox(ctx,1,index_hint));
#ifdef USE_COMPRESSED
if (rc == 0 && ctx->compressinfo)
/* FREE (&h->env->supersedes); should I ? */
if (h2) {
h2->superseded = 1;
- if (option (OPTSCORE))
+ if (!ctx->counting && option (OPTSCORE))
mutt_score_message (ctx, h2, 1);
}
}
/* add this message to the hash tables */
if (ctx->id_hash && h->env->message_id)
hash_insert (ctx->id_hash, h->env->message_id, h, 0);
- if (ctx->subj_hash && h->env->real_subj)
- hash_insert (ctx->subj_hash, h->env->real_subj, h, 1);
+ if (!ctx->counting) {
+ if (ctx->subj_hash && h->env->real_subj)
+ hash_insert (ctx->subj_hash, h->env->real_subj, h, 1);
- if (option (OPTSCORE))
- mutt_score_message (ctx, h, 0);
+ if (option (OPTSCORE))
+ mutt_score_message (ctx, h, 0);
+ }
if (h->changed)
ctx->changed = 1;
if (MX_COMMAND(i,type) < 1) EXITWITHERR("type");
if (!MX_COMMAND(i,mx_is_magic)) EXITWITHERR("mx_is_magic");
if (!MX_COMMAND(i,mx_open_mailbox)) EXITWITHERR("mx_open_mailbox");
+/* if (!MX_COMMAND(i,mx_sync_mailbox)) EXITWITHERR("mx_sync_mailbox");*/
}
#undef EXITWITHERR
#endif /* DEBUG */
#define _MX_H
#include <sys/stat.h>
+#include <utime.h>
/*
* supported mailbox formats
/* check ACL flags; if not implemented, always assume granted
* permissions */
int (*mx_acl_check) (CONTEXT*, int);
+ /* fast closing */
+ void (*mx_fastclose_mailbox) (CONTEXT*);
+ /* write out changes */
+ int (*mx_sync_mailbox) (CONTEXT*, int, int*);
} mx_t;
/* called from main: init all folder types */
#define M_READONLY (1<<2) /* open in read-only mode */
#define M_QUIET (1<<3) /* do not print any messages */
#define M_NEWFOLDER (1<<4) /* create a new folder - same as M_APPEND, but uses
- * safe_fopen() for mbox-style folders.
- */
+ * safe_fopen() for mbox-style folders. */
+#define M_COUNT (1<<5) /* just do counting? needed to do speed optimizations
+ for sidebar */
/* mx_open_new_message() */
#define M_ADD_FROM 1 /* add a From_ line */
fmt->mx_is_magic = nntp_is_magic;
fmt->mx_open_mailbox = nntp_open_mailbox;
fmt->mx_acl_check = acl_check_nntp;
+ fmt->mx_fastclose_mailbox = nntp_fastclose_mailbox;
+ fmt->mx_sync_mailbox = nntp_sync_mailbox;
return (fmt);
}
FREE (p);
}
-int nntp_sync_mailbox (CONTEXT * ctx)
+int nntp_sync_mailbox (CONTEXT * ctx, int unused1, int* unused2)
{
NNTP_DATA *data = ctx->data;
return -1;
}
}
- nntp_sync_mailbox (ctx);
+ nntp_sync_mailbox (ctx, 0, NULL);
if (ctx->data && ((NNTP_DATA *) ctx->data)->nserv) {
NNTP_SERVER *news;
void nntp_clear_cacheindex (NNTP_SERVER *);
int mutt_newsrc_update (NNTP_SERVER *);
int nntp_open_mailbox (CONTEXT *);
-int nntp_sync_mailbox (CONTEXT *);
+int nntp_sync_mailbox (CONTEXT *, int, int*);
int nntp_check_mailbox (CONTEXT *);
int nntp_close_mailbox (CONTEXT *);
void nntp_fastclose_mailbox (CONTEXT *);
#include "attach.h"
#include "mbyte.h"
#include "sidebar.h"
+#include "buffy.h"
#include "mx.h"
break;
case OP_BUFFY_LIST:
- mutt_buffy_list ();
+ buffy_list ();
redraw |= REDRAW_SIDEBAR;
break;
fmt->mx_is_magic = pop_is_magic;
fmt->mx_open_mailbox = pop_open_mailbox;
fmt->mx_acl_check = acl_check_pop;
+ fmt->mx_fastclose_mailbox = pop_close_mailbox;
+ fmt->mx_sync_mailbox = pop_sync_mailbox;
return (fmt);
}
}
/* update POP mailbox - delete messages from server */
-pop_query_status pop_sync_mailbox (CONTEXT * ctx, int *index_hint)
+pop_query_status pop_sync_mailbox (CONTEXT * ctx, int unused, int *index_hint)
{
int i;
pop_query_status ret;
/* pop.c */
int pop_check_mailbox (CONTEXT *, int *);
int pop_open_mailbox (CONTEXT *);
-pop_query_status pop_sync_mailbox (CONTEXT *, int *);
+pop_query_status pop_sync_mailbox (CONTEXT *, int, int *);
int pop_fetch_message (MESSAGE *, CONTEXT *, int);
void pop_close_mailbox (CONTEXT *);
void pop_fetch_mail (void);
void mutt_body_handler (BODY *, STATE *);
int mutt_bounce_message (FILE * fp, HEADER *, ADDRESS *);
void mutt_break_thread (HEADER *);
-void mutt_buffy (char *, size_t);
-int mutt_buffy_list (void);
void mutt_canonical_charset (char *, size_t, const char *);
void mutt_check_rescore (CONTEXT *);
void mutt_clear_error (void);
int mutt_alias_complete (char *, size_t);
int mutt_alloc_color (int fg, int bg);
int mutt_any_key_to_continue (const char *);
-int mutt_buffy_check (int);
-int mutt_buffy_notify (void);
int mutt_builtin_editor (const char *, HEADER *, HEADER *);
int mutt_can_decode (BODY *);
int mutt_change_flag (HEADER *, int);
int mutt_parse_uncolor (BUFFER *, BUFFER *, unsigned long, BUFFER *);
int mutt_parse_hook (BUFFER *, BUFFER *, unsigned long, BUFFER *);
int mutt_parse_macro (BUFFER *, BUFFER *, unsigned long, BUFFER *);
-int mutt_parse_mailboxes (BUFFER *, BUFFER *, unsigned long, BUFFER *);
int mutt_parse_mono (BUFFER *, BUFFER *, unsigned long, BUFFER *);
int mutt_parse_unmono (BUFFER *, BUFFER *, unsigned long, BUFFER *);
int mutt_parse_push (BUFFER *, BUFFER *, unsigned long, BUFFER *);
else if (!prev_show_value && option (OPTMBOXPANE)) {
SidebarWidth = saveSidebarWidth;
/* after toggle: force recounting of all mail */
- mutt_buffy_check (2);
+ buffy_check (2);
}
prev_show_value = option (OPTMBOXPANE);
}
void sidebar_set_buffystats (CONTEXT *);
const char* sidebar_get_current (void);
void sidebar_set_current (const char*);
-/* returns one if mutt_buffy_check should thorougly count */
+/* returns one if buff_check should thorougly count */
int sidebar_need_count (void);
#endif /* _SIDEBAR_H */
#include "sort.h"
#include "mapping.h"
#include "mx.h"
+#include "buffy.h"
#include "lib/mem.h"
#include "lib/intl.h"
case 'b':
if (!optional) {
snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
- snprintf (buf, buflen, fmt, mutt_buffy_check (0));
+ snprintf (buf, buflen, fmt, buffy_check (0));
}
- else if (!mutt_buffy_check (0))
+ else if (!buffy_check (0))
optional = 0;
break;