~ubuntu-dev/ubuntu/lucid/mutt/lucid-201002110857

« back to all changes in this revision

Viewing changes to browser.c

  • Committer: Bazaar Package Importer
  • Author(s): Antonio Radici
  • Date: 2009-06-14 20:53:18 UTC
  • mfrom: (1.3.1 upstream)
  • mto: (2.1.3 squeeze)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: james.westby@ubuntu.com-20090614205318-wf0sqy1o3km636li
Tags: 1.5.20-1
* New upstream release, includes the following features:
  + Bounced messages contains From: headers (Closes: 93268)
  + Attachments displayed based on Content-Disposition (Closes: 199709)
  + fcc to a mailbox does not raise the 'new' flag (Closes: 209390)
  + '!' supported as suffix in gpg keys (Closes: 277945)
  + failed attachment saving shows an error message (Closes: 292350)
  + inline signed messages sent honouring $send_charset (Closes: 307819)
  + support for <clear-flag> and <set-flag> in the pager (Closes: 436007)
  + fcc_attach is a quad option (Closes: 478861)
  + Content-Description header not included in reply (Closes: 500766)
  + imap_sync_mailbox fix for a segfault (Closes: 516364)
  + better threading support with particular Message-ID's (Closes: 520735)
  + no crash on IMAP folder refresh (Closes: 528465)
  + undisclosed-recipients not passed in the envelope (Closes: 529090)
* debian/patches/series:
  + commented all references to upstream/*, they should be included in 1.5.20
  + removed debian-specific/529838-gnutls-autoconf.patch, ditto
  + removed misc/manpage-typos.patch, ditto 
  + modified misc/hyphen-as-minus.patch, a big part was integrated upstream
  + features/trash-folder: do not reupload messages to $trash if IMAP is used
    (Closes: #448241)
  + added misc/hg.pmdef.debugtime, see upstream #3263
* debian/control: added DM-Upload-Allowed: yes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
 
2
 * Copyright (C) 1996-2000,2007 Michael R. Elkins <me@mutt.org>
3
3
 * 
4
4
 *     This program is free software; you can redistribute it and/or modify
5
5
 *     it under the terms of the GNU General Public License as published by
46
46
  { N_("Chdir"), OP_CHANGE_DIRECTORY },
47
47
  { N_("Mask"),  OP_ENTER_MASK },
48
48
  { N_("Help"),  OP_HELP },
49
 
  { NULL }
 
49
  { NULL,        0 }
50
50
};
51
51
 
52
52
typedef struct folder_t
460
460
    if ((! S_ISREG (s.st_mode)) && (! S_ISDIR (s.st_mode)) &&
461
461
        (! S_ISLNK (s.st_mode)))
462
462
      continue;
 
463
 
 
464
    if (mx_is_maildir (tmp->path))
 
465
    {
 
466
      struct stat st2;
 
467
      char md[_POSIX_PATH_MAX];
 
468
 
 
469
      snprintf (md, sizeof (md), "%s/new", tmp->path);
 
470
      if (stat (md, &s) < 0)
 
471
        s.st_mtime = 0;
 
472
      snprintf (md, sizeof (md), "%s/cur", tmp->path);
 
473
      if (stat (md, &st2) < 0)
 
474
        st2.st_mtime = 0;
 
475
      if (st2.st_mtime > s.st_mtime)
 
476
        s.st_mtime = st2.st_mtime;
 
477
    }
463
478
    
464
479
    strfcpy (buffer, NONULL(tmp->path), sizeof (buffer));
465
 
    mutt_pretty_mailbox (buffer);
 
480
    mutt_pretty_mailbox (buffer, sizeof (buffer));
466
481
 
467
482
    add_folder (menu, state, buffer, &s, tmp->new);
468
483
  }
508
523
  else
509
524
  {
510
525
    strfcpy (path, LastDir, sizeof (path));
511
 
    mutt_pretty_mailbox (path);
 
526
    mutt_pretty_mailbox (path, sizeof (path));
512
527
#ifdef USE_IMAP
513
528
  if (state->imap_browse && option (OPTIMAPLSUB))
514
529
    snprintf (title, titlelen, _("Subscribed [%s], File mask: %s"),
645
660
  if (examine_directory (NULL, &state, LastDir, prefix) == -1)
646
661
    goto bail;
647
662
 
648
 
  menu = mutt_new_menu ();
649
 
  menu->menu = MENU_FOLDER;
 
663
  menu = mutt_new_menu (MENU_FOLDER);
650
664
  menu->make_entry = folder_entry;
651
665
  menu->search = select_file_search;
652
666
  menu->title = title;
861
875
 
862
876
      case OP_BROWSER_TOGGLE_LSUB:
863
877
        if (option (OPTIMAPLSUB))
864
 
        {
865
878
          unset_option (OPTIMAPLSUB);
866
 
        }
867
879
        else
868
 
        {
869
880
          set_option (OPTIMAPLSUB);
870
 
        }
 
881
 
871
882
        mutt_ungetch (0, OP_CHECK_NEW);
872
883
        break;
873
884
 
874
885
      case OP_CREATE_MAILBOX:
875
886
        if (!state.imap_browse)
 
887
        {
876
888
          mutt_error (_("Create is only supported for IMAP mailboxes"));
877
 
        else
 
889
          break;
 
890
        }
 
891
 
 
892
        if (!imap_mailbox_create (LastDir))
878
893
        {
879
 
          imap_mailbox_create (LastDir);
880
894
          /* TODO: find a way to detect if the new folder would appear in
881
895
           *   this window, and insert it without starting over. */
882
896
          destroy_state (&state);
890
904
          init_menu (&state, menu, title, sizeof (title), buffy);
891
905
          MAYBE_REDRAW (menu->redraw);
892
906
        }
 
907
        /* else leave error on screen */
893
908
        break;
894
909
 
895
910
      case OP_RENAME_MAILBOX:
899
914
        {
900
915
          int nentry = menu->current;
901
916
 
902
 
          if (imap_mailbox_rename (state.entry[nentry].name) >= 0) {
 
917
          if (imap_mailbox_rename (state.entry[nentry].name) >= 0)
 
918
          {
903
919
            destroy_state (&state);
904
920
            init_state (&state, NULL);
905
921
            state.imap_browse = 1;