--- ./Makefile 2014-09-11 12:28:45.000000000 +0200 +++ ./Makefile 2014-11-16 19:16:40.000000000 +0100 @@ -3,7 +3,7 @@ PORTNAME= mutt PORTVERSION= 1.5.23 -PORTREVISION?= 5 +PORTREVISION?= 6 CATEGORIES+= mail ipv6 MASTER_SITES= ftp://ftp.mutt.org/mutt/ \ ftp://ftp.mutt.org/mutt/devel/ \ @@ -110,8 +110,8 @@ IMAP_HEADER_CACHE LOCALES_FIX MAILBOX_MANPAGES \ MAILDIR_HEADER_CACHE MAILDIR_MTIME_PATCH NLS \ NCURSES PARENT_CHILD_MATCH_PATCH QUOTE_PATCH \ - REVERSE_REPLY_PATCH SIDEBAR_PATCH SMART_DATE \ - SMIME_OUTLOOK_COMPAT SASL SMTP TRASH_PATCH XML + REVERSE_REPLY_PATCH SMART_DATE SMIME_OUTLOOK_COMPAT \ + SASL SMTP TRASH_PATCH XML .endif .include @@ -345,9 +345,11 @@ .if ${PORT_OPTIONS:MNNTP} post-patch:: @${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-sidebar-nntp + @${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-sidebar-refresh .else post-patch:: @${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-sidebar + @${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-sidebar-refresh .endif .endif --- ./files/extra-patch-sidebar-refresh 1970-01-01 01:00:00.000000000 +0100 +++ ./files/extra-patch-sidebar-refresh 2014-10-02 17:43:13.634798000 +0200 @@ -0,0 +1,113 @@ +--- mutt.orig/buffy.c 2012-11-02 13:16:39.000000000 +0100 ++++ mutt/buffy.c 2012-11-02 13:20:52.000000000 +0100 +@@ -26,6 +26,7 @@ + #include "mx.h" + + #include "mutt_curses.h" ++#include "sidebar.h" + + #ifdef USE_IMAP + #include "imap.h" +@@ -564,19 +565,28 @@ + { + case M_MBOX: + case M_MMDF: +- buffy_mbox_update (tmp); ++ if (sidebar_should_refresh()) { ++ buffy_mbox_update (tmp); ++ sidebar_updated(); ++ } + if (buffy_mbox_hasnew (tmp, &sb) > 0) + BuffyCount++; + break; + + case M_MAILDIR: +- buffy_maildir_update (tmp); ++ if (sidebar_should_refresh()) { ++ buffy_maildir_update (tmp); ++ sidebar_updated(); ++ } + if (buffy_maildir_hasnew (tmp) > 0) + BuffyCount++; + break; + + case M_MH: +- mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged); ++ if (sidebar_should_refresh()) { ++ mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged); ++ sidebar_updated(); ++ } + mh_buffy(tmp); + if (tmp->new) + BuffyCount++; +Index: mutt/globals.h +=================================================================== +--- mutt.orig/globals.h 2012-11-02 13:16:39.000000000 +0100 ++++ mutt/globals.h 2012-11-02 13:16:40.000000000 +0100 +@@ -214,6 +214,8 @@ + WHERE struct buffy_t *CurBuffy INITVAL(0); + WHERE short DrawFullLine INITVAL(0); + WHERE short SidebarWidth; ++WHERE short SidebarRefresh; ++WHERE short SidebarLastRefresh; + #ifdef USE_IMAP + WHERE short ImapKeepalive; + WHERE short ImapPipelineDepth; +Index: mutt/init.h +=================================================================== +--- mutt.orig/init.h 2012-11-02 13:16:39.000000000 +0100 ++++ mutt/init.h 2012-11-02 13:16:40.000000000 +0100 +@@ -2009,6 +2009,12 @@ + { "sidebar_width", DT_NUM, R_BOTH, UL &SidebarWidth, 0 }, + /* + ** .pp ++ ** Do not refresh sidebar in less than $sidebar_refresh seconds, ++ ** (0 disables refreshing). ++ */ ++ { "sidebar_refresh", DT_NUM, R_BOTH, UL &SidebarRefresh, 60 }, ++ /* ++ ** .pp + ** The width of the sidebar. + */ + { "sidebar_shortpath", DT_BOOL, R_BOTH, OPTSIDEBARSHORTPATH, 0 }, +Index: mutt/sidebar.c +=================================================================== +--- mutt.orig/sidebar.c 2012-11-02 13:16:39.000000000 +0100 ++++ mutt/sidebar.c 2012-11-02 13:16:40.000000000 +0100 +@@ -252,6 +252,7 @@ + saveSidebarWidth = SidebarWidth; + if(!option(OPTSIDEBAR)) SidebarWidth = 0; + initialized = true; ++ SidebarLastRefresh = time(NULL); + } + + /* save or restore the value SidebarWidth */ +@@ -464,3 +465,16 @@ + set_curbuffy(""); /* default is the first mailbox */ + draw_sidebar(menu); + } ++ ++int sidebar_should_refresh() ++{ ++ if (option(OPTSIDEBAR) && SidebarRefresh > 0) { ++ if (time(NULL) - SidebarLastRefresh >= SidebarRefresh) ++ return 1; ++ } ++ return 0; ++} ++void sidebar_updated() ++{ ++ SidebarLastRefresh = time(NULL); ++} +Index: mutt/sidebar.h +=================================================================== +--- mutt.orig/sidebar.h 2012-11-02 13:16:39.000000000 +0100 ++++ mutt/sidebar.h 2012-11-02 13:16:40.000000000 +0100 +@@ -32,5 +32,7 @@ + void scroll_sidebar(int, int); + void set_curbuffy(char*); + void set_buffystats(CONTEXT*); ++int sidebar_should_refresh(); ++void sidebar_updated(); + + #endif /* SIDEBAR_H */