Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 387330 Details for
Bug 526696
mail-client/mutt[sidebar] fix message counts
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
sidebar-counts.patch
sidebar-counts.patch (text/plain), 2.30 KB, created by
SpanKY
on 2014-10-25 05:50:40 UTC
(
hide
)
Description:
sidebar-counts.patch
Filename:
MIME Type:
Creator:
SpanKY
Created:
2014-10-25 05:50:40 UTC
Size:
2.30 KB
patch
obsolete
>--- a/buffy.c >+++ b/buffy.c >@@ -394,22 +394,15 @@ static int buffy_maildir_hasnew (BUFFY* mailbox) > } > > /* update message counts for the sidebar */ >-void buffy_maildir_update (BUFFY* mailbox) >+static void buffy_maildir_update_dir (BUFFY* mailbox, const char *dir) > { > char path[_POSIX_PATH_MAX]; > DIR *dirp; > struct dirent *de; > char *p; >+ int read; > >- if(!option(OPTSIDEBAR)) >- return; >- >- mailbox->msgcount = 0; >- mailbox->msg_unread = 0; >- mailbox->msg_flagged = 0; >- >- snprintf (path, sizeof (path), "%s/new", mailbox->path); >- >+ snprintf (path, sizeof (path), "%s/%s", mailbox->path, dir); > if ((dirp = opendir (path)) == NULL) > { > mailbox->magic = 0; >@@ -421,42 +414,37 @@ void buffy_maildir_update (BUFFY* mailbox) > if (*de->d_name == '.') > continue; > >- if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) { >- mailbox->new = 1; >- mailbox->msgcount++; >- mailbox->msg_unread++; >+ /* Matches maildir_parse_flags logic */ >+ read = 0; >+ mailbox->msgcount++; >+ if ((p = strstr (de->d_name, ":2,"))) { >+ p += 3; >+ if (strchr (p, 'S')) >+ read = 1; >+ if (strchr (p, 'F')) >+ mailbox->msg_flagged++; > } >+ if (!read) >+ mailbox->msg_unread++; > } > > closedir (dirp); >- snprintf (path, sizeof (path), "%s/cur", mailbox->path); >- >- if ((dirp = opendir (path)) == NULL) >- { >- mailbox->magic = 0; >- return; >- } >- >- while ((de = readdir (dirp)) != NULL) >- { >- if (*de->d_name == '.') >- continue; >+} >+void buffy_maildir_update (BUFFY* mailbox) >+{ >+ if (!option(OPTSIDEBAR)) >+ return; > >- if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) { >- mailbox->msgcount++; >- if ((p = strstr (de->d_name, ":2,"))) { >- if (!strchr (p + 3, 'T')) { >- if (!strchr (p + 3, 'S')) >- mailbox->msg_unread++; >- if (strchr(p + 3, 'F')) >- mailbox->msg_flagged++; >- } >- } >- } >- } >+ mailbox->msgcount = 0; >+ mailbox->msg_unread = 0; >+ mailbox->msg_flagged = 0; >+ >+ buffy_maildir_update_dir (mailbox, "new"); >+ if (mailbox->msgcount) >+ mailbox->new = 1; >+ buffy_maildir_update_dir (mailbox, "cur"); > > mailbox->sb_last_checked = time(NULL); >- closedir (dirp); > } > > /* returns 1 if mailbox has new mail */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 526696
: 387330