]> git.llucax.com Git - software/mutt-debian.git/blobdiff - debian/patches/mutt-patched/sidebar
Pull patch from upstream to fix multipart decoding. (Closes: #489283)
[software/mutt-debian.git] / debian / patches / mutt-patched / sidebar
index e04d3dbc42081aaee7cb7f157417d80887b5229d..0c155cd8b35a8673b831df7c91e761cf3aafe0df 100644 (file)
@@ -23,7 +23,8 @@ in the "mutt-patched" package.
     The width of the sidebar.
 
 * Patch source:
     The width of the sidebar.
 
 * Patch source:
-  - http://lunar-linux.org/~tchan/mutt/patch-1.5.18.sidebar.20080517.txt
+  - http://www.lunar-linux.org/index.php?page=mutt-sidebar
+  - http://lunar-linux.org/~tchan/mutt/patch-1.5.18.sidebar.20080611.txt
 
 * Changes made:
   - Fixed conflict with maildir-mtime patch [myon]
 
 * Changes made:
   - Fixed conflict with maildir-mtime patch [myon]
@@ -49,7 +50,7 @@ in the "mutt-patched" package.
  #ifdef USE_IMAP
      if (tmp->magic != M_IMAP)
  #endif
  #ifdef USE_IMAP
      if (tmp->magic != M_IMAP)
  #endif
-@@ -353,30 +355,51 @@ int mutt_buffy_check (int force)
+@@ -353,10 +355,27 @@ int mutt_buffy_check (int force)
        case M_MBOX:
        case M_MMDF:
  
        case M_MBOX:
        case M_MMDF:
  
@@ -80,19 +81,13 @@ in the "mutt-patched" package.
        }
        else if (option(OPTCHECKMBOXSIZE))
        {
        }
        else if (option(OPTCHECKMBOXSIZE))
        {
-         /* some other program has deleted mail from the folder */
-         tmp->size = (long) sb.st_size;
-       }
--      if (tmp->newly_created &&
--          (sb.st_ctime != sb.st_mtime || sb.st_ctime != sb.st_atime))
--        tmp->newly_created = 0;
+@@ -366,17 +385,21 @@ int mutt_buffy_check (int force)
+       if (tmp->newly_created &&
+           (sb.st_ctime != sb.st_mtime || sb.st_ctime != sb.st_atime))
+         tmp->newly_created = 0;
 -
 -
--      break;
-+        if (tmp->newly_created &&
-+            (sb.st_ctime != sb.st_mtime || sb.st_ctime != sb.st_atime))
-+          tmp->newly_created = 0;
 +        }
 +        }
-       break;
+       break;
  
        case M_MAILDIR:
  
  
        case M_MAILDIR:
  
@@ -943,7 +938,7 @@ in the "mutt-patched" package.
        break;
 --- /dev/null
 +++ b/sidebar.c
        break;
 --- /dev/null
 +++ b/sidebar.c
-@@ -0,0 +1,328 @@
+@@ -0,0 +1,333 @@
 +/*
 + * Copyright (C) ????-2004 Justin Hibbits <jrh29@po.cwru.edu>
 + * Copyright (C) 2004 Thomer M. Gil <mutt@thomer.com>
 +/*
 + * Copyright (C) ????-2004 Justin Hibbits <jrh29@po.cwru.edu>
 + * Copyright (C) 2004 Thomer M. Gil <mutt@thomer.com>
@@ -1083,8 +1078,6 @@ in the "mutt-patched" package.
 +int draw_sidebar(int menu) {
 +
 +      int lines = option(OPTHELP) ? 1 : 0;
 +int draw_sidebar(int menu) {
 +
 +      int lines = option(OPTHELP) ? 1 : 0;
-+      int sidebar_folder_depth;
-+      char *sidebar_folder_name;
 +      BUFFY *tmp;
 +#ifndef USE_SLANG_CURSES
 +        attr_t attrs;
 +      BUFFY *tmp;
 +#ifndef USE_SLANG_CURSES
 +        attr_t attrs;
@@ -1189,28 +1182,35 @@ in the "mutt-patched" package.
 +                      tmp->msgcount = Context->msgcount;
 +                      tmp->msg_flagged = Context->flagged;
 +              }
 +                      tmp->msgcount = Context->msgcount;
 +                      tmp->msg_flagged = Context->flagged;
 +              }
-+      sidebar_folder_depth = 0;
-+      sidebar_folder_name = "<null>"; // ... just in case
-+      if ( strlen(tmp->path) > strlen(Maildir) ) {
-+              int i;
-+              char *tmp_folder_name;
-+              tmp_folder_name = tmp->path + strlen(Maildir);
-+              for (i = 0; i < strlen(tmp->path) - strlen(Maildir); i++) {
-+                      if (tmp_folder_name[i] == '/') sidebar_folder_depth++;
-+              }
-+              if (sidebar_folder_depth > 0) {
-+                      sidebar_folder_name = malloc(strlen(basename(tmp->path)) + sidebar_folder_depth + 1);
-+                      for (i=0; i < sidebar_folder_depth; i++)
-+                              sidebar_folder_name[i]=' ';
-+                      sidebar_folder_name[i]=0;
-+                      strncat(sidebar_folder_name, basename(tmp->path), strlen(basename(tmp->path)) + sidebar_folder_depth);
++              // check whether Maildir is a prefix of the current folder's path
++              short maildir_is_prefix = 0;
++              if ( (strlen(tmp->path) > strlen(Maildir)) &&
++                      (strncmp(Maildir, tmp->path, strlen(Maildir)) == 0) )
++                      maildir_is_prefix = 1;
++              // calculate depth of current folder and generate its display name with indented spaces
++              int sidebar_folder_depth = 0;
++              char *sidebar_folder_name;
++              sidebar_folder_name = basename(tmp->path);
++              if ( maildir_is_prefix ) {
++                      char *tmp_folder_name;
++                      int i;
++                      tmp_folder_name = tmp->path + strlen(Maildir);
++                      for (i = 0; i < strlen(tmp->path) - strlen(Maildir); i++) {
++                              if (tmp_folder_name[i] == '/') sidebar_folder_depth++;
++                      }   
++                      if (sidebar_folder_depth > 0) {
++                              sidebar_folder_name = malloc(strlen(basename(tmp->path)) + sidebar_folder_depth + 1);
++                              for (i=0; i < sidebar_folder_depth; i++)
++                                      sidebar_folder_name[i]=' ';
++                              sidebar_folder_name[i]=0;
++                              strncat(sidebar_folder_name, basename(tmp->path), strlen(basename(tmp->path)) + sidebar_folder_depth);
++                      }
 +              }
 +              }
-+      } else sidebar_folder_name = "INBOX";
-+                printw( "%.*s", SidebarWidth - delim_len + 1,
-+                       make_sidebar_entry(sidebar_folder_name, tmp->msgcount,
-+                       tmp->msg_unread, tmp->msg_flagged));
-+      if (sidebar_folder_depth > 0)
-+              free(sidebar_folder_name);
++              printw( "%.*s", SidebarWidth - delim_len + 1,
++                      make_sidebar_entry(sidebar_folder_name, tmp->msgcount,
++                      tmp->msg_unread, tmp->msg_flagged));
++              if (sidebar_folder_depth > 0)
++                      free(sidebar_folder_name);
 +              lines++;
 +      }
 +      SETCOLOR(MT_COLOR_NORMAL);
 +              lines++;
 +      }
 +      SETCOLOR(MT_COLOR_NORMAL);
@@ -1313,7 +1313,7 @@ in the "mutt-patched" package.
 +#endif /* SIDEBAR_H */
 --- a/doc/Muttrc
 +++ b/doc/Muttrc
 +#endif /* SIDEBAR_H */
 --- a/doc/Muttrc
 +++ b/doc/Muttrc
-@@ -2085,6 +2085,26 @@ attachments   -I message/external-body
+@@ -2090,6 +2090,26 @@ attachments   -I message/external-body
  # function.
  # 
  # 
  # function.
  # 
  #