summaryrefslogtreecommitdiffstats
path: root/browser.c
diff options
context:
space:
mode:
authorBrendan Cully <brendan@kublai.com>2005-02-17 03:33:00 +0000
committerBrendan Cully <brendan@kublai.com>2005-02-17 03:33:00 +0000
commitf405b35ba01c6aa6d71975600db9a478a373ffad (patch)
treefb5ff1ef05922894502ffc29d8567fa03776329c /browser.c
parentc3a2edc870ba709fea462045e20627abeca5441e (diff)
New function: rename-mailbox (bound to 'r' by default).
The lack of a rename-mailbox command for IMAP finally got too annoying. It's a bit of a cut-and-paste job, but I've put my dreams of cleaning up the IMAP codebase on hold. Gotta grow up some time.
Diffstat (limited to 'browser.c')
-rw-r--r--browser.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/browser.c b/browser.c
index d38f7689..108efd4e 100644
--- a/browser.c
+++ b/browser.c
@@ -875,7 +875,28 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
}
break;
- case OP_DELETE_MAILBOX:
+ case OP_RENAME_MAILBOX:
+ if (!state.entry[menu->current].imap)
+ mutt_error (_("Rename is only supported for IMAP mailboxes"));
+ else
+ {
+ int nentry = menu->current;
+
+ if (imap_mailbox_rename (state.entry[nentry].name) >= 0) {
+ destroy_state (&state);
+ init_state (&state, NULL);
+ state.imap_browse = 1;
+ imap_browse (LastDir, &state);
+ menu->data = state.entry;
+ menu->current = 0;
+ menu->top = 0;
+ init_menu (&state, menu, title, sizeof (title), buffy);
+ MAYBE_REDRAW (menu->redraw);
+ }
+ }
+ break;
+
+ case OP_DELETE_MAILBOX:
if (!state.entry[menu->current].imap)
mutt_error (_("Delete is only supported for IMAP mailboxes"));
else