X-Git-Url: https://git.llucax.com/software/mutt-debian.git/blobdiff_plain/ce1ba79962bf3591769c910ba8bbb383405c86ab..03b1cdcfa8f8af19d0c103517f1b808df6e87dfb:/debian/patches/mutt-patched/sidebar diff --git a/debian/patches/mutt-patched/sidebar b/debian/patches/mutt-patched/sidebar index 9b669d9..0c155cd 100644 --- a/debian/patches/mutt-patched/sidebar +++ b/debian/patches/mutt-patched/sidebar @@ -23,7 +23,8 @@ in the "mutt-patched" package. The width of the sidebar. * Patch source: - - provided by dann frazier in #277637 + - 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] @@ -49,7 +50,7 @@ in the "mutt-patched" package. #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: @@ -80,19 +81,13 @@ in the "mutt-patched" package. } 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: @@ -943,7 +938,7 @@ in the "mutt-patched" package. break; --- /dev/null +++ b/sidebar.c -@@ -0,0 +1,328 @@ +@@ -0,0 +1,333 @@ +/* + * Copyright (C) ????-2004 Justin Hibbits + * Copyright (C) 2004 Thomer M. Gil @@ -1083,8 +1078,6 @@ in the "mutt-patched" package. +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; @@ -1189,28 +1182,35 @@ in the "mutt-patched" package. + tmp->msgcount = Context->msgcount; + tmp->msg_flagged = Context->flagged; + } -+ sidebar_folder_depth = 0; -+ sidebar_folder_name = ""; // ... 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); @@ -1313,7 +1313,7 @@ in the "mutt-patched" package. +#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. # #