-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0018-Fix-Buffy-Sidebar-and-mail_check_recent-issues.patch
78 lines (67 loc) · 2.31 KB
/
0018-Fix-Buffy-Sidebar-and-mail_check_recent-issues.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
From e0565fb7c303acebc0761111b06d63cf7166781b Mon Sep 17 00:00:00 2001
From: Julius Plenz <[email protected]>
Date: Wed, 30 Nov 2011 14:25:31 +0100
Subject: [PATCH 18/19] Fix Buffy/Sidebar and mail_check_recent issues
Signed-off-by: Julius Plenz <[email protected]>
---
buffy.c | 17 ++++++-----------
mx.c | 3 ++-
2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/buffy.c b/buffy.c
index fa76a49..e58d4f1 100644
--- a/buffy.c
+++ b/buffy.c
@@ -301,11 +301,6 @@ static int buffy_maildir_hasnew (BUFFY* mailbox)
snprintf (path, sizeof (path), "%s/new", mailbox->path);
- if (option(OPTSIDEBAR) && mailbox->msg_unread > 0) {
- mailbox->new = 1;
- return 1;
- }
-
/* when $mail_check_recent is set, if the new/ directory hasn't been modified since
* the user last exited the mailbox, then we know there is no recent mail.
*/
@@ -315,6 +310,11 @@ static int buffy_maildir_hasnew (BUFFY* mailbox)
return 0;
}
+ if (option(OPTSIDEBAR) && mailbox->msg_unread > 0) {
+ mailbox->new = 1;
+ return 1;
+ }
+
if ((dirp = opendir (path)) == NULL)
{
mailbox->magic = 0;
@@ -426,7 +426,7 @@ static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb)
else
statcheck = sb->st_mtime > sb->st_atime
|| (mailbox->newly_created && sb->st_ctime == sb->st_mtime && sb->st_ctime == sb->st_atime);
- if (statcheck)
+ if ((!option(OPTSIDEBAR) && statcheck) || (option(OPTSIDEBAR) && mailbox->msg_unread > 0))
{
if (!option(OPTMAILCHECKRECENT) || sb->st_mtime > mailbox->last_visited)
{
@@ -443,11 +443,6 @@ static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb)
(sb->st_ctime != sb->st_mtime || sb->st_ctime != sb->st_atime))
mailbox->newly_created = 0;
- if (option(OPTSIDEBAR) && mailbox->msg_unread > 0) {
- mailbox->new = 1;
- rc = 1;
- }
-
return rc;
}
diff --git a/mx.c b/mx.c
index 24ffe2e..6903559 100644
--- a/mx.c
+++ b/mx.c
@@ -722,7 +722,8 @@ void mx_fastclose_mailbox (CONTEXT *ctx)
/* never announce that a mailbox we've just left has new mail. #3290
* XXX: really belongs in mx_close_mailbox, but this is a nice hook point */
- mutt_buffy_setnotified(ctx->path);
+ if(!ctx->peekonly)
+ mutt_buffy_setnotified(ctx->path);
if (ctx->mx_close)
ctx->mx_close (ctx);
--
1.7.7.3