X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=curs_main.c;h=28921a386c14d1f29d42409b6527bb0c238416db;hp=14bb5529ce8a1a7645b1aa015e15b31b09abef27;hb=ce92f8c407db309ef5c3262cff1bd77d0a91b77d;hpb=e9cbbd6d2f13c05021af4470332317c727acb693 diff --git a/curs_main.c b/curs_main.c index 14bb552..28921a3 100644 --- a/curs_main.c +++ b/curs_main.c @@ -1431,6 +1431,86 @@ CHECK_IMAP_ACL(IMAP_ACL_DELETE); menu->redraw = REDRAW_CURRENT; break; + case OP_MAIN_BREAK_THREAD: + + CHECK_MSGCOUNT; + CHECK_VISIBLE; + CHECK_READONLY; + + if ((Sort & SORT_MASK) != SORT_THREADS) + mutt_error _("Threading is not enabled."); + +#if defined (USE_IMAP) && ! defined (IMAP_EDIT_THREADS) + else if (Context->magic == M_IMAP) + mutt_error _("Compile Mutt with --enable-imap-edit-threads for break-thread support"); +#endif + else + { + { + HEADER *oldcur = CURHDR; + + mutt_break_thread (CURHDR); + mutt_sort_headers (Context, 1); + menu->current = oldcur->virtual; + } + + Context->changed = 1; + mutt_message _("Thread broken"); + + if (menu->menu == MENU_PAGER) + { + op = OP_DISPLAY_MESSAGE; + continue; + } + else + menu->redraw |= REDRAW_INDEX; + } + break; + + case OP_MAIN_LINK_THREADS: + + CHECK_MSGCOUNT; + CHECK_VISIBLE; + CHECK_READONLY; + + if ((Sort & SORT_MASK) != SORT_THREADS) + mutt_error _("Threading is not enabled."); + +#if defined (USE_IMAP) && ! defined (IMAP_EDIT_THREADS) + else if (Context->magic == M_IMAP) + mutt_error _("Compile Mutt with --enable-imap-edit-threads for link-threads support"); +#endif + + else if (!CURHDR->env->message_id) + mutt_error _("No Message-ID: header available to link thread"); + else if (!tag && (!Context->last_tag || !Context->last_tag->tagged)) + mutt_error _("First, please tag a message to be linked here"); + else + { + HEADER *oldcur = CURHDR; + + if (mutt_link_threads (CURHDR, tag ? NULL : Context->last_tag, + Context)) + { + mutt_sort_headers (Context, 1); + menu->current = oldcur->virtual; + + Context->changed = 1; + mutt_message _("Threads linked"); + } + else + mutt_error _("No thread linked"); + } + + if (menu->menu == MENU_PAGER) + { + op = OP_DISPLAY_MESSAGE; + continue; + } + else + menu->redraw |= REDRAW_STATUS | REDRAW_INDEX; + break; + case OP_MAIN_NEXT_UNDELETED: CHECK_MSGCOUNT; @@ -2246,7 +2326,11 @@ CHECK_IMAP_ACL(IMAP_ACL_SEEN); case OP_FORWARD_TO_GROUP: CHECK_ATTACH; - if (op != OP_FOLLOWUP || !CURHDR->env->followup_to || + if ((op == OP_FOLLOWUP || op == OP_FORWARD_TO_GROUP) && + Context && Context->msgcount == 0) { + mutt_error (_("There are no messages.")); + sleep (2); + } else if (op != OP_FOLLOWUP || !CURHDR->env->followup_to || mutt_strcasecmp (CURHDR->env->followup_to, "poster") || query_quadoption (OPT_FOLLOWUPTOPOSTER,_("Reply by mail as poster prefers?")) != M_YES) {