From: ak1 Date: Thu, 24 Feb 2005 14:12:33 +0000 (+0000) Subject: Andreas Krennmair: X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=commitdiff_plain;h=82c978b426a6669d432c22f0773d807e2a974747 Andreas Krennmair: Integrated another sidebar fix and a build fix from Rocco Rutte (thanks!). git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@85 e385b8ad-14ed-0310-8656-cc95a2468c6d --- diff --git a/ChangeLog.mutt-ng b/ChangeLog.mutt-ng index ea52d03..3c8a68d 100644 --- a/ChangeLog.mutt-ng +++ b/ChangeLog.mutt-ng @@ -1,5 +1,8 @@ Changes specific to mutt-ng: +2005-02-24: + * Integrated another sidebar fix and a build fix from Rocco Rutte. + 2005-02-23: * Integrated assume_charset patch from http://www.emaillab.org/mutt/download15.html.en * Integrated patch by Rocco Rutte to correct minor bugs diff --git a/Makefile.am b/Makefile.am index cee6217..2c7e37e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ ## Use aclocal -I m4; automake --foreign AUTOMAKE_OPTIONS = foreign -EXTRA_PROGRAMS = muttng_dotlock pgpring makedoc +EXTRA_PROGRAMS = muttng_dotlock pgpringng pgpewrapng makedoc if BUILD_IMAP IMAP_SUBDIR = imap @@ -86,9 +86,13 @@ muttng_dotlock_SOURCES = mutt_dotlock.c muttng_dotlock_LDADD = @LIBOBJS@ muttng_dotlock_DEPENDENCIES = @LIBOBJS@ -pgpring_SOURCES = pgppubring.c pgplib.c lib.c extlib.c sha1.c md5c.c pgppacket.c ascii.c -pgpring_LDADD = @LIBOBJS@ $(INTLLIBS) -pgpring_DEPENDENCIES = @LIBOBJS@ $(INTLDEPS) +pgpringng_SOURCES = pgppubring.c pgplib.c lib.c extlib.c sha1.c md5c.c pgppacket.c ascii.c +pgpringng_LDADD = @LIBOBJS@ $(INTLLIBS) +pgpringng_DEPENDENCIES = @LIBOBJS@ $(INTLDEPS) + +pgpewrapng_SOURCES = pgpewrap.c +pgpewrapng_LDADD = +pgpewrapng_DEPENDENCIES = mutt_dotlock.c: dotlock.c cp $(srcdir)/dotlock.c mutt_dotlock.c @@ -106,9 +110,9 @@ fleang: muttbug.sh cp muttbug.sh fleang chmod +x fleang -smime_keys: $(srcdir)/smime_keys.pl - cp $(srcdir)/smime_keys.pl smime_keys - chmod +x smime_keys +smime_keysng: $(srcdir)/smime_keys.pl + cp $(srcdir)/smime_keys.pl smime_keysng + chmod +x smime_keysng Makefile: $(BUILT_SOURCES) @@ -147,7 +151,7 @@ install-data-local: Muttngrc $(INSTALL) -m 644 $(srcdir)/Muttngrc $(DESTDIR)$(sysconfdir) ; \ fi -if [ ! -f $(DESTDIR)$(sysconfdir)/mime.types ]; then \ - $(INSTALL) -m 644 $(srcdir)/mime.types $(DESTDIR)$(sysconfdir); \ + $(INSTALL) -m 644 $(srcdir)/mime.types $(DESTDIR)$(sysconfdir)/muttng-mime.types; \ fi diff --git a/TODO.mutt-ng b/TODO.mutt-ng index 3507253..506f5b7 100644 --- a/TODO.mutt-ng +++ b/TODO.mutt-ng @@ -1,10 +1,10 @@ -Here's a list of all mutt-ng specific TODOs: +Here's a list of all mutt-ng specific TODOs (not in priority order): -rename smime_keys, pgpewrap and pgpring muttngbug must call fleang, not flea -We need to modify the build scripts and paths in the source so that mutt-ng doesn't conflict in any -way with mutt. +Really make sure that there're no more files installed with conflicting +paths between mutt <-> mutt-ng. Update documentation to state that +there're new version of all helper programs. We need to do a security audit. At least remove all the unsafe function calls, even when they're marked with "secure" or "checked", and replace it with secure alternatives instead. diff --git a/configure.in b/configure.in index 1fda7bd..3f9cba1 100644 --- a/configure.in +++ b/configure.in @@ -131,7 +131,7 @@ else if test x$have_pgp != xno ; then AC_DEFINE(CRYPT_BACKEND_CLASSIC_PGP,1, [ Define if you want classic PGP support. ]) - PGPAUX_TARGET="pgpring pgpewrap" + PGPAUX_TARGET="pgpringng pgpewrapng" MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS pgp.o pgpinvoke.o pgpkey.o pgplib.o gnupgparse.o pgpmicalg.o pgppacket.o crypt-mod-pgp-classic.o" fi @@ -145,7 +145,7 @@ else AC_DEFINE(CRYPT_BACKEND_CLASSIC_SMIME,1, [ Define if you want clasic S/MIME support. ]) MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS smime.o crypt-mod-smime-classic.o" - SMIMEAUX_TARGET="smime_keys" + SMIMEAUX_TARGET="smime_keysng" fi AC_ARG_WITH(mixmaster, AC_HELP_STRING([--with-mixmaster[=PATH]], [Include Mixmaster support]), diff --git a/contrib/gpg.rc b/contrib/gpg.rc index 41e9ab3..67fd705 100644 --- a/contrib/gpg.rc +++ b/contrib/gpg.rc @@ -48,12 +48,12 @@ set pgp_sign_command="/usr/bin/gpg --no-verbose --batch --quiet --output - set pgp_clearsign_command="/usr/bin/gpg --charset utf-8 --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --textmode --clearsign %?a?-u %a? %f" # create a pgp/mime encrypted attachment -# set pgp_encrypt_only_command="pgpewrap gpg-2comp -v --batch --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f" -set pgp_encrypt_only_command="pgpewrap /usr/bin/gpg --charset utf-8 --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f" +# set pgp_encrypt_only_command="pgpewrapng gpg-2comp -v --batch --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f" +set pgp_encrypt_only_command="pgpewrapng /usr/bin/gpg --charset utf-8 --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f" # create a pgp/mime encrypted and signed attachment -# set pgp_encrypt_sign_command="pgpewrap gpg-2comp --passphrase-fd 0 -v --batch --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f" -set pgp_encrypt_sign_command="pgpewrap /usr/bin/gpg --charset utf-8 %?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f" +# set pgp_encrypt_sign_command="pgpewrapng gpg-2comp --passphrase-fd 0 -v --batch --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f" +set pgp_encrypt_sign_command="pgpewrapng /usr/bin/gpg --charset utf-8 %?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f" # import a key into the public key ring set pgp_import_command="/usr/bin/gpg --no-verbose --import %f" diff --git a/contrib/pgp2.rc b/contrib/pgp2.rc index e8150ca..0ef2505 100644 --- a/contrib/pgp2.rc +++ b/contrib/pgp2.rc @@ -39,10 +39,10 @@ set pgp_export_command="pgp -kxaf +language=mutt %r" set pgp_verify_key_command="pgp -kcc +language=mutt %r" # read in the public key ring -set pgp_list_pubring_command="pgpring -2 %r" +set pgp_list_pubring_command="pgpringng -2 %r" # read in the secret key ring -set pgp_list_secring_command="pgpring -s -2 %r" +set pgp_list_secring_command="pgpringng -s -2 %r" # pattern for good signature set pgp_good_sign="Good signature" diff --git a/contrib/pgp5.rc b/contrib/pgp5.rc index e0eaf18..de0879f 100644 --- a/contrib/pgp5.rc +++ b/contrib/pgp5.rc @@ -21,10 +21,10 @@ set pgp_decrypt_command="PGPPASSFD=0; export PGPPASSFD; cat - %f | pgpv +languag set pgp_sign_command="PGPPASSFD=0; export PGPPASSFD; cat - %f | pgps +language=mutt +verbose=0 +batchmode -abft %?a? -u %a?" # create a pgp/mime encrypted attachment -set pgp_encrypt_only_command="pgpewrap pgpe +language=mutt +verbose=0 +batchmode +nobatchinvalidkeys=off -aft -- -r %r < %f" +set pgp_encrypt_only_command="pgpewrapng pgpe +language=mutt +verbose=0 +batchmode +nobatchinvalidkeys=off -aft -- -r %r < %f" # create a pgp/mime encrypted and signed attachment -set pgp_encrypt_sign_command="PGPPASSFD=0; export PGPPASSFD; cat - %f | pgpewrap pgpe +language=mutt +verbose=0 +batchmode +nobatchinvalidkeys=off -afts %?a? -u %a? -- -r %r" +set pgp_encrypt_sign_command="PGPPASSFD=0; export PGPPASSFD; cat - %f | pgpewrapng pgpe +language=mutt +verbose=0 +batchmode +nobatchinvalidkeys=off -afts %?a? -u %a? -- -r %r" # import a key into the public key ring set pgp_import_command="pgpk -a +language=mutt --OutputInformationFD=1 %f" @@ -36,9 +36,9 @@ set pgp_export_command="pgpk -xa +language=mutt --OutputInformationFD=1 %r" set pgp_verify_key_command="pgpk -c +batchmode +language=mutt --OutputInformationFD=1 %r" # read in the public key ring -set pgp_list_pubring_command="pgpring -5 %r" +set pgp_list_pubring_command="pgpringng -5 %r" # read in the secret key ring -set pgp_list_secring_command="pgpring -5 -s %r" +set pgp_list_secring_command="pgpringng -5 -s %r" diff --git a/contrib/pgp6.rc b/contrib/pgp6.rc index 5e05afd..a35263c 100644 --- a/contrib/pgp6.rc +++ b/contrib/pgp6.rc @@ -33,10 +33,10 @@ set pgp_export_command="pgp6 +compatible -kxaf %r" set pgp_verify_key_command="pgp6 +compatible -kcc %r" # read in the public key ring -set pgp_list_pubring_command="pgpring -5 %r" +set pgp_list_pubring_command="pgpringng -5 %r" # read in the secret key ring -set pgp_list_secring_command="pgpring -s -5 %r" +set pgp_list_secring_command="pgpringng -s -5 %r" # create a clearsigned message set pgp_clearsign_command="PGPPASSFD=0; export PGPPASSFD; cat - %f | pgp6 +compatible +verbose=0 +batchmode +clearsig -afst %?a? -u %a?" diff --git a/contrib/smime.rc b/contrib/smime.rc index 635496b..368273b 100644 --- a/contrib/smime.rc +++ b/contrib/smime.rc @@ -51,8 +51,8 @@ set smime_get_signer_cert_command="openssl smime -verify -in %f -noverify -signe # This is used to get the email address the certificate was issued to. set smime_get_cert_email_command="openssl x509 -in %f -noout -email" -# Add a certificate to the database using smime_keys. -set smime_import_cert_command="smime_keys add_cert %f" +# Add a certificate to the database using smime_keysng. +set smime_import_cert_command="smime_keysng add_cert %f" diff --git a/curs_main.c b/curs_main.c index 7a01bad..5981766 100644 --- a/curs_main.c +++ b/curs_main.c @@ -609,6 +609,7 @@ int mutt_index_menu (void) SETCOLOR (MT_COLOR_STATUS); mutt_paddstr (COLS, buf); SETCOLOR (MT_COLOR_NORMAL); + set_buffystats (Context); menu->redraw &= ~REDRAW_STATUS; if (option(OPTXTERMSETTITLES)) { diff --git a/sidebar.c b/sidebar.c index 85605bd..8adea8f 100644 --- a/sidebar.c +++ b/sidebar.c @@ -27,6 +27,7 @@ #include #include "keymap.h" #include +#include /*BUFFY *CurBuffy = 0;*/ static BUFFY *TopBuffy = 0; @@ -45,6 +46,23 @@ static int quick_log10(int n) return (++len); } +static int cur_is_hidden (int maxline) +{ + int l = 0, seen = 0; + BUFFY* tmp = TopBuffy; + if (!CurBuffy) + return (0); + while (tmp && l < maxline && !seen) + { + if (strcmp (tmp->path, CurBuffy->path) == 0) + seen = 1; + else + tmp = tmp->next; + l++; + } + return (seen == 0 || l == maxline); +} + void calc_boundaries (int menu) { BUFFY *tmp = Incoming; @@ -59,7 +77,7 @@ void calc_boundaries (int menu) if ( TopBuffy == 0 && BottomBuffy == 0 ) TopBuffy = Incoming; if ( BottomBuffy == 0 ) { - int count = LINES - 2 - (menu != MENU_PAGER); + int count = LINES - 2 - (menu != MENU_PAGER || option (OPTSTATUSONTOP)); BottomBuffy = TopBuffy; while ( --count && BottomBuffy->next ) BottomBuffy = BottomBuffy->next; @@ -87,8 +105,11 @@ static char * shortened_hierarchy(char * box) { char * last_dot; int i,j; char * new_box; - for (i=0;ipath, Context->path) == 0) + { + tmp->msg_unread = Context->unread; + tmp->msgcount = Context->msgcount; + break; + } + tmp = tmp->next; + } +} + int draw_sidebar(int menu) { int lines = option(OPTHELP) ? 1 : 0; BUFFY *tmp; -#ifndef USE_SLANG_CURSES - attr_t attrs; -#endif - short color_pair; short delim_len = mutt_strlen (SidebarDelim); /* initialize first time */ @@ -194,39 +226,30 @@ int draw_sidebar(int menu) { prev_show_value = option(OPTMBOXPANE); } - if ( SidebarWidth == 0 ) return 0; - /* get attributes for divider */ - SETCOLOR(MT_COLOR_STATUS); -#ifndef USE_SLANG_CURSES - attr_get(&attrs, &color_pair, 0); -#else - color_pair = attr_get(); -#endif - SETCOLOR(MT_COLOR_NORMAL); - /* draw the divider */ - - for ( ; lines < LINES-1-(menu != MENU_PAGER); lines++ ) { + SETCOLOR(MT_COLOR_STATUS); + for (lines = option (OPTSTATUSONTOP) ? 0 : 1; + lines < LINES-1-(menu != MENU_PAGER || option (OPTSTATUSONTOP)); lines++ ) { move(lines, SidebarWidth - delim_len); addstr (NONULL (SidebarDelim)); - #ifndef USE_SLANG_CURSES - mvchgat(lines, SidebarWidth - delim_len, delim_len, 0, color_pair, NULL); - #endif } + SETCOLOR(MT_COLOR_NORMAL); + if ( Incoming == 0 ) return 0; lines = option(OPTHELP) ? 1 : 0; /* go back to the top */ + if (cur_is_hidden (LINES-1-(menu != MENU_PAGER))) + CurBuffy = TopBuffy; + if ( known_lines != LINES || TopBuffy == 0 || BottomBuffy == 0 ) calc_boundaries(menu); if ( CurBuffy == 0 ) CurBuffy = Incoming; tmp = TopBuffy; - SETCOLOR(MT_COLOR_NORMAL); - - for ( ; tmp && lines < LINES-1 - (menu != MENU_PAGER); tmp = tmp->next ) { + for ( ; tmp && lines < LINES-1 - (menu != MENU_PAGER || option (OPTSTATUSONTOP)); tmp = tmp->next ) { if ( tmp == CurBuffy ) SETCOLOR(MT_COLOR_INDICATOR); else if ( tmp->msg_unread > 0 ) @@ -249,7 +272,7 @@ int draw_sidebar(int menu) { lines++; } SETCOLOR(MT_COLOR_NORMAL); - for ( ; lines < LINES - 1 - (menu != MENU_PAGER); lines++ ) { + for ( ; lines < LINES - 1 - (menu != MENU_PAGER || option (OPTSTATUSONTOP)); lines++ ) { int i = 0; move( lines, 0 ); for ( ; i < SidebarWidth - delim_len; i++ ) diff --git a/sidebar.h b/sidebar.h index a6647d4..4e7bbf3 100644 --- a/sidebar.h +++ b/sidebar.h @@ -20,16 +20,11 @@ #ifndef SIDEBAR_H #define SIDEBAR_H -struct MBOX_LIST { - char *path; - int msgcount; - int new; -} MBLIST; - /* parameter is whether or not to go to the status line */ /* used for omitting the last | that covers up the status bar in the index */ int draw_sidebar(int); void scroll_sidebar(int, int); void set_curbuffy(char*); +void set_buffystats (CONTEXT*); #endif /* SIDEBAR_H */