Ticket #20412: patch-1.5.20.cd.purge_message.diff

File patch-1.5.20.cd.purge_message.diff, 6.9 KB (added by carter.tjoseph@…, 15 years ago)
  • mutt-1.5.

    diff -u mutt-1.5.20-trashfolder/OPS mutt-1.5.20-trash+purge/OPS
    old new  
    141141OP_PREV_LINE "scroll up one line"
    142142OP_PREV_PAGE "move to the previous page"
    143143OP_PRINT "print the current entry"
     144OP_PURGE_MESSAGE "really delete the current entry, bypassing the trash folder"
    144145OP_QUERY "query external program for addresses"
    145146OP_QUERY_APPEND "append new query results to current results"
    146147OP_QUIT "save changes to mailbox and quit"
  • curs_main.c

    Common subdirectories: mutt-1.5.20-trashfolder/contrib and mutt-1.5.20-trash+purge/contrib
    diff -u mutt-1.5.20-trashfolder/curs_main.c mutt-1.5.20-trash+purge/curs_main.c
    old new  
    18031803        MAYBE_REDRAW (menu->redraw);
    18041804        break;
    18051805
     1806      case OP_PURGE_MESSAGE:
    18061807      case OP_DELETE:
    18071808
    18081809        CHECK_MSGCOUNT;
     
    18131814        if (tag)
    18141815        {
    18151816          mutt_tag_set_flag (M_DELETE, 1);
     1817          mutt_tag_set_flag (M_PURGED, (op != OP_PURGE_MESSAGE) ? 0 : 1);
    18161818          if (option (OPTDELETEUNTAG))
    18171819            mutt_tag_set_flag (M_TAG, 0);
    18181820          menu->redraw = REDRAW_INDEX;
     
    18201822        else
    18211823        {
    18221824          mutt_set_flag (Context, CURHDR, M_DELETE, 1);
     1825          mutt_set_flag (Context, CURHDR, M_PURGED,
     1826                          (op != OP_PURGE_MESSAGE) ? 0 : 1);
    18231827          if (option (OPTDELETEUNTAG))
    18241828            mutt_set_flag (Context, CURHDR, M_TAG, 0);
    18251829          if (option (OPTRESOLVE))
     
    21162120        if (tag)
    21172121        {
    21182122          mutt_tag_set_flag (M_DELETE, 0);
     2123          mutt_tag_set_flag (M_PURGED, 0);
    21192124          menu->redraw = REDRAW_INDEX;
    21202125        }
    21212126        else
    21222127        {
    21232128          mutt_set_flag (Context, CURHDR, M_DELETE, 0);
     2129          mutt_set_flag (Context, CURHDR, M_PURGED, 0);
    21242130          if (option (OPTRESOLVE) && menu->current < Context->vcount - 1)
    21252131          {
    21262132            menu->current++;
     
    21412147        CHECK_ACL(M_ACL_DELETE, _("undelete message(s)"));
    21422148
    21432149        rc = mutt_thread_set_flag (CURHDR, M_DELETE, 0,
    2144                                    op == OP_UNDELETE_THREAD ? 0 : 1);
     2150                        op == OP_UNDELETE_THREAD ? 0 : 1)
     2151                + mutt_thread_set_flag (CURHDR, M_PURGED, 0,
     2152                                op == OP_UNDELETE_THREAD ? 0 : 1);
    21452153
    2146         if (rc != -1)
     2154        if (rc > -1)
    21472155        {
    21482156          if (option (OPTRESOLVE))
    21492157          {
  • mutt-1.5.

    Common subdirectories: mutt-1.5.20-trashfolder/doc and mutt-1.5.20-trash+purge/doc
    diff -u mutt-1.5.20-trashfolder/flags.c mutt-1.5.20-trash+purge/flags.c
    old new  
    104104      }
    105105      break;
    106106
     107    case M_PURGED:
     108      if (bf)
     109      {
     110        if (!h->purged)
     111          h->purged = 1;
     112      }
     113      else if (h->purged)
     114        h->purged = 0;
     115      break;
     116
    107117    case M_NEW:
    108118
    109119      if (!mutt_bit_isset(ctx->rights,M_ACL_SEEN))
  • functions.h

    diff -u mutt-1.5.20-trashfolder/functions.h mutt-1.5.20-trash+purge/functions.h
    old new  
    120120  { "toggle-write",             OP_TOGGLE_WRITE,                "%" },
    121121  { "next-thread",              OP_MAIN_NEXT_THREAD,            "\016" },
    122122  { "next-subthread",           OP_MAIN_NEXT_SUBTHREAD,         "\033n" },
     123  { "purge-message",            OP_PURGE_MESSAGE,               NULL },
    123124  { "query",                    OP_QUERY,                       "Q" },
    124125  { "quit",                     OP_QUIT,                        "q" },
    125126  { "reply",                    OP_REPLY,                       "r" },
     
    209210  { "print-message",    OP_PRINT,                       "p" },
    210211  { "previous-thread",  OP_MAIN_PREV_THREAD,            "\020" },
    211212  { "previous-subthread",OP_MAIN_PREV_SUBTHREAD,        "\033p" },
     213  { "purge-message",    OP_PURGE_MESSAGE,               NULL },
    212214  { "quit",             OP_QUIT,                        "Q" },
    213215  { "exit",             OP_EXIT,                        "q" },
    214216  { "reply",            OP_REPLY,                       "r" },
  • mutt-1.5.

    Common subdirectories: mutt-1.5.20-trashfolder/imap and mutt-1.5.20-trash+purge/imap
    Common subdirectories: mutt-1.5.20-trashfolder/intl and mutt-1.5.20-trash+purge/intl
    Common subdirectories: mutt-1.5.20-trashfolder/m4 and mutt-1.5.20-trash+purge/m4
    diff -u mutt-1.5.20-trashfolder/mutt.h mutt-1.5.20-trash+purge/mutt.h
    old new  
    188188  M_UNDELETE,
    189189  M_DELETED,
    190190  M_APPENDED,
     191  M_PURGED,
    191192  M_FLAG,
    192193  M_TAG,
    193194  M_UNTAG,
     
    704705  unsigned int tagged : 1;
    705706  unsigned int deleted : 1;
    706707  unsigned int appended : 1;            /* has been saved */
     708  unsigned int purged : 1;              /* bypassing the trash folder */
    707709  unsigned int changed : 1;
    708710  unsigned int attach_del : 1;          /* has an attachment marked for deletion */
    709711  unsigned int old : 1;
  • mutt-1.5.

    diff -u mutt-1.5.20-trashfolder/mx.c mutt-1.5.20-trash+purge/mx.c
    old new  
    803803    {
    804804      for (i = 0 ; i < ctx->msgcount ; i++)
    805805        if (ctx->hdrs[i]->deleted && !ctx->hdrs[i]->appended
     806            && !ctx->hdrs[i]->purged
    806807            && mutt_append_message (ctx_trash, ctx, ctx->hdrs[i], 0, 0) == -1)
    807808          {
    808809            mx_close_mailbox (ctx_trash, NULL);
  • mutt-1.5.

    diff -u mutt-1.5.20-trashfolder/pager.c mutt-1.5.20-trash+purge/pager.c
    old new  
    23092309        MAYBE_REDRAW (redraw);
    23102310        break;
    23112311
     2312      case OP_PURGE_MESSAGE:
    23122313      case OP_DELETE:
    23132314        CHECK_MODE(IsHeader (extra));
    23142315        CHECK_READONLY;
    23152316        CHECK_ACL(M_ACL_DELETE, _("delete message"));
    23162317
    23172318        mutt_set_flag (Context, extra->hdr, M_DELETE, 1);
     2319        mutt_set_flag (Context, extra->hdr, M_PURGED,
     2320                        ch != OP_PURGE_MESSAGE ? 0 : 1);
    23182321        if (option (OPTDELETEUNTAG))
    23192322          mutt_set_flag (Context, extra->hdr, M_TAG, 0);
    23202323        redraw = REDRAW_STATUS | REDRAW_INDEX;
     
    26412644        CHECK_ACL(M_ACL_DELETE, _("undelete message"));
    26422645
    26432646        mutt_set_flag (Context, extra->hdr, M_DELETE, 0);
     2647        mutt_set_flag (Context, extra->hdr, M_PURGED, 0);
    26442648        redraw = REDRAW_STATUS | REDRAW_INDEX;
    26452649        if (option (OPTRESOLVE))
    26462650        {
     
    26562660        CHECK_ACL(M_ACL_DELETE, _("undelete message(s)"));
    26572661
    26582662        r = mutt_thread_set_flag (extra->hdr, M_DELETE, 0,
     2663                                  ch == OP_UNDELETE_THREAD ? 0 : 1)
     2664                + mutt_thread_set_flag (extra->hdr, M_PURGED, 0,
    26592665                                  ch == OP_UNDELETE_THREAD ? 0 : 1);
    26602666
    2661         if (r != -1)
     2667        if (r > -1)
    26622668        {
    26632669          if (option (OPTRESOLVE))
    26642670          {
  • pattern.c

    diff -u mutt-1.5.20-trashfolder/pattern.c mutt-1.5.20-trash+purge/pattern.c
    old new  
    13471347      {
    13481348        switch (op)
    13491349        {
    1350           case M_DELETE:
    13511350          case M_UNDELETE:
     1351            mutt_set_flag (Context, Context->hdrs[Context->v2r[i]], M_PURGED,
     1352                           0);
     1353          case M_DELETE:
    13521354            mutt_set_flag (Context, Context->hdrs[Context->v2r[i]], M_DELETE,
    13531355                          (op == M_DELETE));
    13541356            break;