diff options
author | Brendan Cully <brendan@kublai.com> | 2005-02-17 03:33:00 +0000 |
---|---|---|
committer | Brendan Cully <brendan@kublai.com> | 2005-02-17 03:33:00 +0000 |
commit | f405b35ba01c6aa6d71975600db9a478a373ffad (patch) | |
tree | fb5ff1ef05922894502ffc29d8567fa03776329c /browser.c | |
parent | c3a2edc870ba709fea462045e20627abeca5441e (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.c | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -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 |