Link Here
|
1 |
Taken from http://lunar-linux.org/~tchan/mutt/patch-1.5.23.sidebar.20140412.txt |
1 |
Based on http://lunar-linux.org/~tchan/mutt/patch-1.5.24.sidebar.20151111.txt |
|
|
2 |
- Fixed some flaws with regard to handling of "/" instead of "." for IMAP folders. |
2 |
|
3 |
|
3 |
diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c |
4 |
*** mutt-1.5.24-orig/buffy.c 2015-08-30 12:06:38.000000000 -0500 |
4 |
*** mutt-1.5.23-orig/buffy.c.orig 2015-08-30 19:06:38.000000000 +0200 |
5 |
--- mutt-1.5.24/buffy.c 2015-09-16 23:18:13.000000000 -0500 |
5 |
--- mutt-1.5.23/buffy.c 2015-09-10 09:31:22.000000000 +0200 |
6 |
*************** |
6 |
@@ -161,6 +161,49 @@ |
7 |
*** 161,166 **** |
7 |
} |
8 |
--- 161,209 ---- |
8 |
} |
9 |
} |
9 |
|
10 |
} |
10 |
+static int buffy_compare_name(const void *a, const void *b) { |
11 |
|
11 |
+ const BUFFY *b1 = * (BUFFY * const *) a; |
12 |
+ static int buffy_compare_name(const void *a, const void *b) { |
12 |
+ const BUFFY *b2 = * (BUFFY * const *) b; |
13 |
+ const BUFFY *b1 = * (BUFFY * const *) a; |
13 |
+ |
14 |
+ const BUFFY *b2 = * (BUFFY * const *) b; |
14 |
+ return mutt_strcoll(b1->path, b2->path); |
15 |
+ |
15 |
+} |
16 |
+ return mutt_strcoll(b1->path, b2->path); |
16 |
+ |
17 |
+ } |
17 |
+static BUFFY *buffy_sort(BUFFY *b) |
18 |
+ |
18 |
+{ |
19 |
+ static BUFFY *buffy_sort(BUFFY *b) |
19 |
+ BUFFY *tmp = b; |
20 |
+ { |
20 |
+ int buffycount = 0; |
21 |
+ BUFFY *tmp = b; |
21 |
+ BUFFY **ary; |
22 |
+ int buffycount = 0; |
22 |
+ int i; |
23 |
+ BUFFY **ary; |
23 |
+ |
24 |
+ int i; |
24 |
+ if (!option(OPTSIDEBARSORT)) |
25 |
+ |
25 |
+ return b; |
26 |
+ if (!option(OPTSIDEBARSORT)) |
26 |
+ |
27 |
+ return b; |
27 |
+ for (; tmp != NULL; tmp = tmp->next) |
28 |
+ |
28 |
+ buffycount++; |
29 |
+ for (; tmp != NULL; tmp = tmp->next) |
29 |
+ |
30 |
+ buffycount++; |
30 |
+ ary = (BUFFY **) safe_calloc(buffycount, sizeof (*ary)); |
31 |
+ |
31 |
+ |
32 |
+ ary = (BUFFY **) safe_calloc(buffycount, sizeof (*ary)); |
32 |
+ tmp = b; |
33 |
+ |
33 |
+ for (i = 0; tmp != NULL; tmp = tmp->next, i++) { |
34 |
+ tmp = b; |
34 |
+ ary[i] = tmp; |
35 |
+ for (i = 0; tmp != NULL; tmp = tmp->next, i++) { |
35 |
+ } |
36 |
+ ary[i] = tmp; |
36 |
+ |
37 |
+ } |
37 |
+ qsort(ary, buffycount, sizeof(*ary), buffy_compare_name); |
38 |
+ |
38 |
+ |
39 |
+ qsort(ary, buffycount, sizeof(*ary), buffy_compare_name); |
39 |
+ for (i = 0; i < buffycount - 1; i++) { |
40 |
+ |
40 |
+ ary[i]->next = ary[i+1]; |
41 |
+ for (i = 0; i < buffycount - 1; i++) { |
41 |
+ } |
42 |
+ ary[i]->next = ary[i+1]; |
42 |
+ ary[buffycount - 1]->next = NULL; |
43 |
+ } |
43 |
+ for (i = 1; i < buffycount; i++) { |
44 |
+ ary[buffycount - 1]->next = NULL; |
44 |
+ ary[i]->prev = ary[i-1]; |
45 |
+ for (i = 1; i < buffycount; i++) { |
45 |
+ } |
46 |
+ ary[i]->prev = ary[i-1]; |
46 |
+ ary[0]->prev = NULL; |
47 |
+ } |
47 |
+ |
48 |
+ ary[0]->prev = NULL; |
48 |
+ tmp = ary[0]; |
49 |
+ |
49 |
+ free(ary); |
50 |
+ tmp = ary[0]; |
50 |
+ return tmp; |
51 |
+ free(ary); |
51 |
+} |
52 |
+ return tmp; |
52 |
+ |
53 |
+ } |
53 |
BUFFY *mutt_find_mailbox (const char *path) |
54 |
+ |
54 |
{ |
55 |
BUFFY *mutt_find_mailbox (const char *path) |
55 |
BUFFY *tmp = NULL; |
56 |
{ |
56 |
@@ -196,9 +239,13 @@ |
57 |
BUFFY *tmp = NULL; |
57 |
static BUFFY *buffy_new (const char *path) |
58 |
*************** |
58 |
{ |
59 |
*** 196,204 **** |
59 |
BUFFY* buffy; |
60 |
--- 239,251 ---- |
60 |
+ char rp[PATH_MAX]; |
61 |
static BUFFY *buffy_new (const char *path) |
61 |
+ char *r; |
62 |
{ |
62 |
|
63 |
BUFFY* buffy; |
63 |
buffy = (BUFFY *) safe_calloc (1, sizeof (BUFFY)); |
64 |
+ char rp[PATH_MAX]; |
64 |
strfcpy (buffy->path, path, sizeof (buffy->path)); |
65 |
+ char *r; |
65 |
+ r = realpath(path, rp); |
66 |
|
66 |
+ strfcpy (buffy->realpath, r ? rp : path, sizeof (buffy->realpath)); |
67 |
buffy = (BUFFY *) safe_calloc (1, sizeof (BUFFY)); |
67 |
buffy->next = NULL; |
68 |
strfcpy (buffy->path, path, sizeof (buffy->path)); |
68 |
buffy->magic = 0; |
69 |
+ r = realpath(path, rp); |
69 |
|
70 |
+ strfcpy (buffy->realpath, r ? rp : path, sizeof (buffy->realpath)); |
70 |
@@ -243,8 +290,8 @@ |
71 |
buffy->next = NULL; |
71 |
p = realpath (buf, f1); |
72 |
buffy->magic = 0; |
72 |
for (tmp = &Incoming; *tmp; tmp = &((*tmp)->next)) |
73 |
|
73 |
{ |
74 |
*************** |
74 |
- q = realpath ((*tmp)->path, f2); |
75 |
*** 243,250 **** |
75 |
- if (mutt_strcmp (p ? p : buf, q ? q : (*tmp)->path) == 0) |
76 |
p = realpath (buf, f1); |
76 |
+ q = (*tmp)->realpath; |
77 |
for (tmp = &Incoming; *tmp; tmp = &((*tmp)->next)) |
77 |
+ if (mutt_strcmp (p ? p : buf, q) == 0) |
78 |
{ |
78 |
{ |
79 |
! q = realpath ((*tmp)->path, f2); |
79 |
dprint(3,(debugfile,"mailbox '%s' already registered as '%s'\n", buf, (*tmp)->path)); |
80 |
! if (mutt_strcmp (p ? p : buf, q ? q : (*tmp)->path) == 0) |
80 |
break; |
81 |
{ |
81 |
@@ -282,6 +329,7 @@ |
82 |
dprint(3,(debugfile,"mailbox '%s' already registered as '%s'\n", buf, (*tmp)->path)); |
82 |
else |
83 |
break; |
83 |
(*tmp)->size = 0; |
84 |
--- 290,297 ---- |
84 |
} |
85 |
p = realpath (buf, f1); |
85 |
+ Incoming = buffy_sort(Incoming); |
86 |
for (tmp = &Incoming; *tmp; tmp = &((*tmp)->next)) |
86 |
return 0; |
87 |
{ |
87 |
} |
88 |
! q = (*tmp)->realpath; |
88 |
|
89 |
! if (mutt_strcmp (p ? p : buf, q) == 0) |
89 |
@@ -306,6 +354,11 @@ |
90 |
{ |
90 |
return 0; |
91 |
dprint(3,(debugfile,"mailbox '%s' already registered as '%s'\n", buf, (*tmp)->path)); |
91 |
} |
92 |
break; |
92 |
|
93 |
*************** |
93 |
+ if (option(OPTSIDEBAR) && mailbox->msg_unread > 0) { |
94 |
*** 282,287 **** |
94 |
+ mailbox->new = 1; |
95 |
--- 329,335 ---- |
95 |
+ return 1; |
96 |
else |
96 |
+ } |
97 |
(*tmp)->size = 0; |
97 |
+ |
98 |
} |
98 |
if ((dirp = opendir (path)) == NULL) |
99 |
+ Incoming = buffy_sort(Incoming); |
99 |
{ |
100 |
return 0; |
100 |
mailbox->magic = 0; |
101 |
} |
101 |
@@ -357,6 +410,73 @@ |
102 |
|
102 |
|
103 |
*************** |
103 |
return 0; |
104 |
*** 306,311 **** |
104 |
} |
105 |
--- 354,364 ---- |
105 |
+ |
106 |
return 0; |
106 |
+/* update message counts for the sidebar */ |
107 |
} |
107 |
+void buffy_maildir_update (BUFFY* mailbox) |
108 |
|
108 |
+{ |
109 |
+ if (option(OPTSIDEBAR) && mailbox->msg_unread > 0) { |
|
|
110 |
+ mailbox->new = 1; |
111 |
+ return 1; |
112 |
+ } |
113 |
+ |
114 |
if ((dirp = opendir (path)) == NULL) |
115 |
{ |
116 |
mailbox->magic = 0; |
117 |
*************** |
118 |
*** 357,362 **** |
119 |
--- 410,482 ---- |
120 |
|
121 |
return 0; |
122 |
} |
123 |
+ |
124 |
+ /* update message counts for the sidebar */ |
125 |
+ void buffy_maildir_update (BUFFY* mailbox) |
126 |
+ { |
109 |
+ char path[_POSIX_PATH_MAX]; |
127 |
+ char path[_POSIX_PATH_MAX]; |
110 |
+ DIR *dirp; |
128 |
+ DIR *dirp; |
111 |
+ struct dirent *de; |
129 |
+ struct dirent *de; |
112 |
+ char *p; |
130 |
+ char *p; |
113 |
+ |
131 |
+ |
114 |
+ if(!option(OPTSIDEBAR)) |
132 |
+ if(!option(OPTSIDEBAR)) |
115 |
+ return; |
133 |
+ return; |
116 |
+ |
134 |
+ |
117 |
+ mailbox->msgcount = 0; |
135 |
+ mailbox->msgcount = 0; |
118 |
+ mailbox->msg_unread = 0; |
136 |
+ mailbox->msg_unread = 0; |
119 |
+ mailbox->msg_flagged = 0; |
137 |
+ mailbox->msg_flagged = 0; |
120 |
+ |
138 |
+ |
121 |
+ snprintf (path, sizeof (path), "%s/new", mailbox->path); |
139 |
+ snprintf (path, sizeof (path), "%s/new", mailbox->path); |
122 |
+ |
140 |
+ |
123 |
+ if ((dirp = opendir (path)) == NULL) |
141 |
+ if ((dirp = opendir (path)) == NULL) |
Link Here
|
125 |
+ mailbox->magic = 0; |
143 |
+ mailbox->magic = 0; |
126 |
+ return; |
144 |
+ return; |
127 |
+ } |
145 |
+ } |
128 |
+ |
146 |
+ |
129 |
+ while ((de = readdir (dirp)) != NULL) |
147 |
+ while ((de = readdir (dirp)) != NULL) |
130 |
+ { |
148 |
+ { |
131 |
+ if (*de->d_name == '.') |
149 |
+ if (*de->d_name == '.') |
132 |
+ continue; |
150 |
+ continue; |
133 |
+ |
151 |
+ |
134 |
+ if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) { |
152 |
+ if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) { |
135 |
+ mailbox->new = 1; |
153 |
+ mailbox->new = 1; |
136 |
+ mailbox->msgcount++; |
154 |
+ mailbox->msgcount++; |
137 |
+ mailbox->msg_unread++; |
155 |
+ mailbox->msg_unread++; |
138 |
+ } |
156 |
+ } |
139 |
+ } |
157 |
+ } |
140 |
+ |
158 |
+ |
141 |
+ closedir (dirp); |
159 |
+ closedir (dirp); |
142 |
+ snprintf (path, sizeof (path), "%s/cur", mailbox->path); |
160 |
+ snprintf (path, sizeof (path), "%s/cur", mailbox->path); |
143 |
+ |
161 |
+ |
144 |
+ if ((dirp = opendir (path)) == NULL) |
162 |
+ if ((dirp = opendir (path)) == NULL) |
145 |
+ { |
163 |
+ { |
146 |
+ mailbox->magic = 0; |
164 |
+ mailbox->magic = 0; |
147 |
+ return; |
165 |
+ return; |
148 |
+ } |
166 |
+ } |
149 |
+ |
167 |
+ |
150 |
+ while ((de = readdir (dirp)) != NULL) |
168 |
+ while ((de = readdir (dirp)) != NULL) |
151 |
+ { |
169 |
+ { |
152 |
+ if (*de->d_name == '.') |
170 |
+ if (*de->d_name == '.') |
153 |
+ continue; |
171 |
+ continue; |
154 |
+ |
172 |
+ |
155 |
+ if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) { |
173 |
+ if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) { |
156 |
+ mailbox->msgcount++; |
174 |
+ mailbox->msgcount++; |
157 |
+ if ((p = strstr (de->d_name, ":2,"))) { |
175 |
+ if ((p = strstr (de->d_name, ":2,"))) { |
Link Here
|
164 |
+ } |
182 |
+ } |
165 |
+ } |
183 |
+ } |
166 |
+ } |
184 |
+ } |
167 |
+ |
185 |
+ |
168 |
+ mailbox->sb_last_checked = time(NULL); |
186 |
+ mailbox->sb_last_checked = time(NULL); |
169 |
+ closedir (dirp); |
187 |
+ closedir (dirp); |
170 |
+} |
188 |
+ } |
171 |
+ |
189 |
+ |
172 |
/* returns 1 if mailbox has new mail */ |
190 |
/* returns 1 if mailbox has new mail */ |
173 |
static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb) |
191 |
static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb) |
174 |
{ |
192 |
{ |
175 |
@@ -368,7 +488,7 @@ |
193 |
*************** |
176 |
else |
194 |
*** 368,374 **** |
177 |
statcheck = sb->st_mtime > sb->st_atime |
195 |
else |
178 |
|| (mailbox->newly_created && sb->st_ctime == sb->st_mtime && sb->st_ctime == sb->st_atime); |
196 |
statcheck = sb->st_mtime > sb->st_atime |
179 |
- if (statcheck) |
197 |
|| (mailbox->newly_created && sb->st_ctime == sb->st_mtime && sb->st_ctime == sb->st_atime); |
180 |
+ if ((!option(OPTSIDEBAR) && statcheck) || (option(OPTSIDEBAR) && mailbox->msg_unread > 0)) |
198 |
! if (statcheck) |
181 |
{ |
199 |
{ |
182 |
if (!option(OPTMAILCHECKRECENT) || sb->st_mtime > mailbox->last_visited) |
200 |
if (!option(OPTMAILCHECKRECENT) || sb->st_mtime > mailbox->last_visited) |
183 |
{ |
201 |
{ |
184 |
@@ -388,6 +508,27 @@ |
202 |
--- 488,494 ---- |
185 |
return rc; |
203 |
else |
186 |
} |
204 |
statcheck = sb->st_mtime > sb->st_atime |
187 |
|
205 |
|| (mailbox->newly_created && sb->st_ctime == sb->st_mtime && sb->st_ctime == sb->st_atime); |
188 |
+/* update message counts for the sidebar */ |
206 |
! if ((!option(OPTSIDEBAR) && statcheck) || (option(OPTSIDEBAR) && mailbox->msg_unread > 0)) |
189 |
+void buffy_mbox_update (BUFFY* mailbox, struct stat *sb) |
207 |
{ |
190 |
+{ |
208 |
if (!option(OPTMAILCHECKRECENT) || sb->st_mtime > mailbox->last_visited) |
191 |
+ CONTEXT *ctx = NULL; |
209 |
{ |
192 |
+ |
210 |
*************** |
193 |
+ if(!option(OPTSIDEBAR)) |
211 |
*** 388,393 **** |
194 |
+ return; |
212 |
--- 508,534 ---- |
195 |
+ if(mailbox->sb_last_checked > sb->st_mtime && mailbox->msgcount != 0) |
213 |
return rc; |
196 |
+ return; /* no check necessary */ |
214 |
} |
197 |
+ |
215 |
|
198 |
+ ctx = mx_open_mailbox(mailbox->path, M_READONLY | M_QUIET | M_NOSORT | M_PEEK, NULL); |
216 |
+ /* update message counts for the sidebar */ |
199 |
+ if(ctx) |
217 |
+ void buffy_mbox_update (BUFFY* mailbox, struct stat *sb) |
200 |
+ { |
218 |
+ { |
201 |
+ mailbox->msgcount = ctx->msgcount; |
219 |
+ CONTEXT *ctx = NULL; |
202 |
+ mailbox->msg_unread = ctx->unread; |
220 |
+ |
203 |
+ mailbox->msg_flagged = ctx->flagged; |
221 |
+ if(!option(OPTSIDEBAR)) |
204 |
+ mailbox->sb_last_checked = time(NULL); |
222 |
+ return; |
205 |
+ mx_close_mailbox(ctx, 0); |
223 |
+ if(mailbox->sb_last_checked > sb->st_mtime && mailbox->msgcount != 0) |
206 |
+ } |
224 |
+ return; /* no check necessary */ |
207 |
+} |
225 |
+ |
208 |
+ |
226 |
+ ctx = mx_open_mailbox(mailbox->path, M_READONLY | M_QUIET | M_NOSORT | M_PEEK, NULL); |
209 |
int mutt_buffy_check (int force) |
227 |
+ if(ctx) |
210 |
{ |
228 |
+ { |
211 |
BUFFY *tmp; |
229 |
+ mailbox->msgcount = ctx->msgcount; |
212 |
@@ -461,17 +602,20 @@ |
230 |
+ mailbox->msg_unread = ctx->unread; |
213 |
{ |
231 |
+ mailbox->msg_flagged = ctx->flagged; |
214 |
case M_MBOX: |
232 |
+ mailbox->sb_last_checked = time(NULL); |
215 |
case M_MMDF: |
233 |
+ mx_close_mailbox(ctx, 0); |
216 |
+ buffy_mbox_update (tmp, &sb); |
234 |
+ } |
217 |
if (buffy_mbox_hasnew (tmp, &sb) > 0) |
235 |
+ } |
218 |
BuffyCount++; |
236 |
+ |
219 |
break; |
237 |
int mutt_buffy_check (int force) |
220 |
|
238 |
{ |
221 |
case M_MAILDIR: |
239 |
BUFFY *tmp; |
222 |
+ buffy_maildir_update (tmp); |
240 |
*************** |
223 |
if (buffy_maildir_hasnew (tmp) > 0) |
241 |
*** 461,477 **** |
224 |
BuffyCount++; |
242 |
{ |
225 |
break; |
243 |
case M_MBOX: |
226 |
|
244 |
case M_MMDF: |
227 |
case M_MH: |
245 |
if (buffy_mbox_hasnew (tmp, &sb) > 0) |
228 |
- mh_buffy(tmp); |
246 |
BuffyCount++; |
229 |
+ mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged, &tmp->sb_last_checked); |
247 |
break; |
230 |
+ mh_buffy(tmp); |
248 |
|
231 |
if (tmp->new) |
249 |
case M_MAILDIR: |
232 |
BuffyCount++; |
250 |
if (buffy_maildir_hasnew (tmp) > 0) |
233 |
break; |
251 |
BuffyCount++; |
234 |
*** mutt-1.5.23-orig/buffy.h 2014-03-12 11:03:44.000000000 -0500 |
252 |
break; |
235 |
--- mutt-1.5.23/buffy.h 2014-04-11 10:14:01.000000000 -0500 |
253 |
|
|
|
254 |
case M_MH: |
255 |
! mh_buffy(tmp); |
256 |
if (tmp->new) |
257 |
BuffyCount++; |
258 |
break; |
259 |
--- 602,621 ---- |
260 |
{ |
261 |
case M_MBOX: |
262 |
case M_MMDF: |
263 |
+ buffy_mbox_update (tmp, &sb); |
264 |
if (buffy_mbox_hasnew (tmp, &sb) > 0) |
265 |
BuffyCount++; |
266 |
break; |
267 |
|
268 |
case M_MAILDIR: |
269 |
+ buffy_maildir_update (tmp); |
270 |
if (buffy_maildir_hasnew (tmp) > 0) |
271 |
BuffyCount++; |
272 |
break; |
273 |
|
274 |
case M_MH: |
275 |
! mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged, &tmp->sb_last_checked); |
276 |
! mh_buffy(tmp); |
277 |
if (tmp->new) |
278 |
BuffyCount++; |
279 |
break; |
280 |
*** mutt-1.5.24-orig/buffy.h 2015-08-30 12:06:38.000000000 -0500 |
281 |
--- mutt-1.5.24/buffy.h 2015-09-16 23:18:13.000000000 -0500 |
236 |
*************** |
282 |
*************** |
237 |
*** 23,35 **** |
283 |
*** 23,35 **** |
238 |
--- 23,41 ---- |
284 |
--- 23,41 ---- |
Link Here
|
255 |
} |
301 |
} |
256 |
BUFFY; |
302 |
BUFFY; |
257 |
|
303 |
|
258 |
*** mutt-1.5.23-orig/color.c.orig 2015-08-30 19:06:38.000000000 +0200 |
304 |
*** mutt-1.5.24-orig/color.c 2015-08-30 12:06:38.000000000 -0500 |
259 |
--- mutt-1.5.23/color.c 2015-09-10 09:34:06.000000000 +0200 |
305 |
--- mutt-1.5.24/color.c 2015-09-16 23:18:13.000000000 -0500 |
260 |
@@ -94,6 +94,8 @@ |
306 |
*************** |
261 |
{ "underline", MT_COLOR_UNDERLINE }, |
307 |
*** 94,99 **** |
262 |
{ "index", MT_COLOR_INDEX }, |
308 |
--- 94,101 ---- |
263 |
{ "prompt", MT_COLOR_PROMPT }, |
309 |
{ "underline", MT_COLOR_UNDERLINE }, |
264 |
+ { "sidebar_new", MT_COLOR_NEW }, |
310 |
{ "index", MT_COLOR_INDEX }, |
265 |
+ { "sidebar_flagged", MT_COLOR_FLAGGED }, |
311 |
{ "prompt", MT_COLOR_PROMPT }, |
266 |
{ NULL, 0 } |
312 |
+ { "sidebar_new", MT_COLOR_NEW }, |
267 |
}; |
313 |
+ { "sidebar_flagged", MT_COLOR_FLAGGED }, |
268 |
|
314 |
{ NULL, 0 } |
269 |
*** mutt-1.5.23-orig/compose.c 2014-03-12 11:03:45.000000000 -0500 |
315 |
}; |
270 |
--- mutt-1.5.23/compose.c 2014-04-12 12:15:56.000000000 -0500 |
316 |
|
|
|
317 |
*** mutt-1.5.24-orig/compose.c 2015-08-30 12:06:38.000000000 -0500 |
318 |
--- mutt-1.5.24/compose.c 2015-09-16 23:18:13.000000000 -0500 |
271 |
*************** |
319 |
*************** |
272 |
*** 72,78 **** |
320 |
*** 72,78 **** |
273 |
|
321 |
|
Link Here
|
303 |
if ((WithCrypto & (APPLICATION_PGP | APPLICATION_SMIME)) == 0) |
351 |
if ((WithCrypto & (APPLICATION_PGP | APPLICATION_SMIME)) == 0) |
304 |
{ |
352 |
{ |
305 |
*************** |
353 |
*************** |
306 |
*** 142,148 **** |
354 |
*** 145,151 **** |
307 |
} |
355 |
addstr (_(" (OppEnc mode)")); |
308 |
|
356 |
|
309 |
clrtoeol (); |
357 |
clrtoeol (); |
310 |
! move (HDR_CRYPTINFO, 0); |
358 |
! move (HDR_CRYPTINFO, 0); |
311 |
clrtoeol (); |
359 |
clrtoeol (); |
312 |
|
360 |
|
313 |
if ((WithCrypto & APPLICATION_PGP) |
361 |
if ((WithCrypto & APPLICATION_PGP) |
314 |
--- 142,148 ---- |
362 |
--- 145,151 ---- |
315 |
} |
363 |
addstr (_(" (OppEnc mode)")); |
316 |
|
364 |
|
317 |
clrtoeol (); |
365 |
clrtoeol (); |
318 |
! move (HDR_CRYPTINFO, SidebarWidth); |
366 |
! move (HDR_CRYPTINFO, SidebarWidth); |
Link Here
|
320 |
|
368 |
|
321 |
if ((WithCrypto & APPLICATION_PGP) |
369 |
if ((WithCrypto & APPLICATION_PGP) |
322 |
*************** |
370 |
*************** |
323 |
*** 159,165 **** |
371 |
*** 162,168 **** |
324 |
&& (msg->security & ENCRYPT) |
372 |
&& (msg->security & ENCRYPT) |
325 |
&& SmimeCryptAlg |
373 |
&& SmimeCryptAlg |
326 |
&& *SmimeCryptAlg) { |
374 |
&& *SmimeCryptAlg) { |
Link Here
|
328 |
NONULL(SmimeCryptAlg)); |
376 |
NONULL(SmimeCryptAlg)); |
329 |
} |
377 |
} |
330 |
} |
378 |
} |
331 |
--- 159,165 ---- |
379 |
--- 162,168 ---- |
332 |
&& (msg->security & ENCRYPT) |
380 |
&& (msg->security & ENCRYPT) |
333 |
&& SmimeCryptAlg |
381 |
&& SmimeCryptAlg |
334 |
&& *SmimeCryptAlg) { |
382 |
&& *SmimeCryptAlg) { |
Link Here
|
337 |
} |
385 |
} |
338 |
} |
386 |
} |
339 |
*************** |
387 |
*************** |
340 |
*** 172,178 **** |
388 |
*** 175,181 **** |
341 |
int c; |
389 |
int c; |
342 |
char *t; |
390 |
char *t; |
343 |
|
391 |
|
Link Here
|
345 |
|
393 |
|
346 |
if (!chain) |
394 |
if (!chain) |
347 |
{ |
395 |
{ |
348 |
--- 172,178 ---- |
396 |
--- 175,181 ---- |
349 |
int c; |
397 |
int c; |
350 |
char *t; |
398 |
char *t; |
351 |
|
399 |
|
Link Here
|
354 |
if (!chain) |
402 |
if (!chain) |
355 |
{ |
403 |
{ |
356 |
*************** |
404 |
*************** |
357 |
*** 187,193 **** |
405 |
*** 190,196 **** |
358 |
if (t && t[0] == '0' && t[1] == '\0') |
406 |
if (t && t[0] == '0' && t[1] == '\0') |
359 |
t = "<random>"; |
407 |
t = "<random>"; |
360 |
|
408 |
|
Link Here
|
362 |
break; |
410 |
break; |
363 |
|
411 |
|
364 |
addstr (NONULL(t)); |
412 |
addstr (NONULL(t)); |
365 |
--- 187,193 ---- |
413 |
--- 190,196 ---- |
366 |
if (t && t[0] == '0' && t[1] == '\0') |
414 |
if (t && t[0] == '0' && t[1] == '\0') |
367 |
t = "<random>"; |
415 |
t = "<random>"; |
368 |
|
416 |
|
Link Here
|
371 |
|
419 |
|
372 |
addstr (NONULL(t)); |
420 |
addstr (NONULL(t)); |
373 |
*************** |
421 |
*************** |
374 |
*** 239,245 **** |
422 |
*** 242,248 **** |
375 |
|
423 |
|
376 |
buf[0] = 0; |
424 |
buf[0] = 0; |
377 |
rfc822_write_address (buf, sizeof (buf), addr, 1); |
425 |
rfc822_write_address (buf, sizeof (buf), addr, 1); |
Link Here
|
379 |
mutt_paddstr (W, buf); |
427 |
mutt_paddstr (W, buf); |
380 |
} |
428 |
} |
381 |
|
429 |
|
382 |
--- 239,245 ---- |
430 |
--- 242,248 ---- |
383 |
|
431 |
|
384 |
buf[0] = 0; |
432 |
buf[0] = 0; |
385 |
rfc822_write_address (buf, sizeof (buf), addr, 1); |
433 |
rfc822_write_address (buf, sizeof (buf), addr, 1); |
Link Here
|
388 |
} |
436 |
} |
389 |
|
437 |
|
390 |
*************** |
438 |
*************** |
391 |
*** 249,258 **** |
439 |
*** 252,261 **** |
392 |
draw_envelope_addr (HDR_TO, msg->env->to); |
440 |
draw_envelope_addr (HDR_TO, msg->env->to); |
393 |
draw_envelope_addr (HDR_CC, msg->env->cc); |
441 |
draw_envelope_addr (HDR_CC, msg->env->cc); |
394 |
draw_envelope_addr (HDR_BCC, msg->env->bcc); |
442 |
draw_envelope_addr (HDR_BCC, msg->env->bcc); |
Link Here
|
399 |
mutt_paddstr (W, fcc); |
447 |
mutt_paddstr (W, fcc); |
400 |
|
448 |
|
401 |
if (WithCrypto) |
449 |
if (WithCrypto) |
402 |
--- 249,258 ---- |
450 |
--- 252,261 ---- |
403 |
draw_envelope_addr (HDR_TO, msg->env->to); |
451 |
draw_envelope_addr (HDR_TO, msg->env->to); |
404 |
draw_envelope_addr (HDR_CC, msg->env->cc); |
452 |
draw_envelope_addr (HDR_CC, msg->env->cc); |
405 |
draw_envelope_addr (HDR_BCC, msg->env->bcc); |
453 |
draw_envelope_addr (HDR_BCC, msg->env->bcc); |
Link Here
|
411 |
|
459 |
|
412 |
if (WithCrypto) |
460 |
if (WithCrypto) |
413 |
*************** |
461 |
*************** |
414 |
*** 263,269 **** |
462 |
*** 266,272 **** |
415 |
#endif |
463 |
#endif |
416 |
|
464 |
|
417 |
SETCOLOR (MT_COLOR_STATUS); |
465 |
SETCOLOR (MT_COLOR_STATUS); |
Link Here
|
419 |
clrtoeol (); |
467 |
clrtoeol (); |
420 |
|
468 |
|
421 |
NORMAL_COLOR; |
469 |
NORMAL_COLOR; |
422 |
--- 263,269 ---- |
470 |
--- 266,272 ---- |
423 |
#endif |
471 |
#endif |
424 |
|
472 |
|
425 |
SETCOLOR (MT_COLOR_STATUS); |
473 |
SETCOLOR (MT_COLOR_STATUS); |
Link Here
|
428 |
|
476 |
|
429 |
NORMAL_COLOR; |
477 |
NORMAL_COLOR; |
430 |
*************** |
478 |
*************** |
431 |
*** 299,305 **** |
479 |
*** 302,308 **** |
432 |
/* redraw the expanded list so the user can see the result */ |
480 |
/* redraw the expanded list so the user can see the result */ |
433 |
buf[0] = 0; |
481 |
buf[0] = 0; |
434 |
rfc822_write_address (buf, sizeof (buf), *addr, 1); |
482 |
rfc822_write_address (buf, sizeof (buf), *addr, 1); |
Link Here
|
436 |
mutt_paddstr (W, buf); |
484 |
mutt_paddstr (W, buf); |
437 |
|
485 |
|
438 |
return 0; |
486 |
return 0; |
439 |
--- 299,305 ---- |
487 |
--- 302,308 ---- |
440 |
/* redraw the expanded list so the user can see the result */ |
488 |
/* redraw the expanded list so the user can see the result */ |
441 |
buf[0] = 0; |
489 |
buf[0] = 0; |
442 |
rfc822_write_address (buf, sizeof (buf), *addr, 1); |
490 |
rfc822_write_address (buf, sizeof (buf), *addr, 1); |
Link Here
|
445 |
|
493 |
|
446 |
return 0; |
494 |
return 0; |
447 |
*************** |
495 |
*************** |
448 |
*** 544,550 **** |
496 |
*** 562,568 **** |
449 |
if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0) |
497 |
if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0) |
450 |
{ |
498 |
{ |
451 |
mutt_str_replace (&msg->env->subject, buf); |
499 |
mutt_str_replace (&msg->env->subject, buf); |
Link Here
|
453 |
if (msg->env->subject) |
501 |
if (msg->env->subject) |
454 |
mutt_paddstr (W, msg->env->subject); |
502 |
mutt_paddstr (W, msg->env->subject); |
455 |
else |
503 |
else |
456 |
--- 544,550 ---- |
504 |
--- 562,568 ---- |
457 |
if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0) |
505 |
if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0) |
458 |
{ |
506 |
{ |
459 |
mutt_str_replace (&msg->env->subject, buf); |
507 |
mutt_str_replace (&msg->env->subject, buf); |
Link Here
|
462 |
mutt_paddstr (W, msg->env->subject); |
510 |
mutt_paddstr (W, msg->env->subject); |
463 |
else |
511 |
else |
464 |
*************** |
512 |
*************** |
465 |
*** 562,568 **** |
513 |
*** 580,586 **** |
466 |
{ |
514 |
{ |
467 |
strfcpy (fcc, buf, fcclen); |
515 |
strfcpy (fcc, buf, fcclen); |
468 |
mutt_pretty_mailbox (fcc, fcclen); |
516 |
mutt_pretty_mailbox (fcc, fcclen); |
Link Here
|
470 |
mutt_paddstr (W, fcc); |
518 |
mutt_paddstr (W, fcc); |
471 |
fccSet = 1; |
519 |
fccSet = 1; |
472 |
} |
520 |
} |
473 |
--- 562,568 ---- |
521 |
--- 580,586 ---- |
474 |
{ |
522 |
{ |
475 |
strfcpy (fcc, buf, fcclen); |
523 |
strfcpy (fcc, buf, fcclen); |
476 |
mutt_pretty_mailbox (fcc, fcclen); |
524 |
mutt_pretty_mailbox (fcc, fcclen); |
Link Here
|
478 |
mutt_paddstr (W, fcc); |
526 |
mutt_paddstr (W, fcc); |
479 |
fccSet = 1; |
527 |
fccSet = 1; |
480 |
} |
528 |
} |
481 |
*** mutt-1.5.23-orig/configure.ac 2014-03-12 11:26:40.000000000 -0500 |
529 |
*** mutt-1.5.24-orig/configure.ac 2015-08-30 12:24:20.000000000 -0500 |
482 |
--- mutt-1.5.23/configure.ac 2014-04-11 10:14:01.000000000 -0500 |
530 |
--- mutt-1.5.24/configure.ac 2015-09-16 23:18:13.000000000 -0500 |
483 |
*************** |
531 |
*************** |
484 |
*** 1276,1281 **** |
532 |
*** 1302,1307 **** |
485 |
--- 1276,1283 ---- |
533 |
--- 1302,1309 ---- |
486 |
AC_DEFINE(HAVE_LANGINFO_YESEXPR,1,[ Define if you have <langinfo.h> and nl_langinfo(YESEXPR). ]) |
534 |
AC_DEFINE(HAVE_LANGINFO_YESEXPR,1,[ Define if you have <langinfo.h> and nl_langinfo(YESEXPR). ]) |
487 |
fi |
535 |
fi |
488 |
|
536 |
|
Link Here
|
491 |
dnl Documentation tools |
539 |
dnl Documentation tools |
492 |
have_openjade="no" |
540 |
have_openjade="no" |
493 |
AC_PATH_PROG([OSPCAT], [ospcat], [none]) |
541 |
AC_PATH_PROG([OSPCAT], [ospcat], [none]) |
494 |
*** mutt-1.5.23-orig/curs_main.c 2014-03-12 11:06:17.000000000 -0500 |
542 |
*** mutt-1.5.24-orig/curs_main.c 2015-08-30 12:06:38.000000000 -0500 |
495 |
--- mutt-1.5.23/curs_main.c 2014-04-12 21:45:21.000000000 -0500 |
543 |
--- mutt-1.5.24/curs_main.c 2015-09-16 23:18:13.000000000 -0500 |
496 |
*************** |
544 |
*************** |
497 |
*** 26,32 **** |
545 |
*** 26,32 **** |
498 |
--- 26,34 ---- |
546 |
--- 26,34 ---- |
Link Here
|
506 |
#ifdef USE_POP |
554 |
#ifdef USE_POP |
507 |
#include "pop.h" |
555 |
#include "pop.h" |
508 |
*************** |
556 |
*************** |
509 |
*** 519,538 **** |
557 |
*** 596,615 **** |
510 |
menu->redraw |= REDRAW_STATUS; |
558 |
menu->redraw |= REDRAW_STATUS; |
511 |
if (do_buffy_notify) |
559 |
if (do_buffy_notify) |
512 |
{ |
560 |
{ |
Link Here
|
527 |
} |
575 |
} |
528 |
|
576 |
|
529 |
if (menu->menu == MENU_MAIN) |
577 |
if (menu->menu == MENU_MAIN) |
530 |
--- 521,551 ---- |
578 |
--- 598,628 ---- |
531 |
menu->redraw |= REDRAW_STATUS; |
579 |
menu->redraw |= REDRAW_STATUS; |
532 |
if (do_buffy_notify) |
580 |
if (do_buffy_notify) |
533 |
{ |
581 |
{ |
Link Here
|
560 |
|
608 |
|
561 |
if (menu->menu == MENU_MAIN) |
609 |
if (menu->menu == MENU_MAIN) |
562 |
*************** |
610 |
*************** |
563 |
*** 554,562 **** |
611 |
*** 631,639 **** |
564 |
--- 567,578 ---- |
612 |
--- 644,655 ---- |
565 |
|
613 |
|
566 |
if (menu->redraw & REDRAW_STATUS) |
614 |
if (menu->redraw & REDRAW_STATUS) |
567 |
{ |
615 |
{ |
Link Here
|
575 |
NORMAL_COLOR; |
623 |
NORMAL_COLOR; |
576 |
menu->redraw &= ~REDRAW_STATUS; |
624 |
menu->redraw &= ~REDRAW_STATUS; |
577 |
*************** |
625 |
*************** |
578 |
*** 569,575 **** |
626 |
*** 653,659 **** |
579 |
menu->oldcurrent = -1; |
627 |
menu->oldcurrent = -1; |
580 |
|
628 |
|
581 |
if (option (OPTARROWCURSOR)) |
629 |
if (option (OPTARROWCURSOR)) |
Link Here
|
583 |
else if (option (OPTBRAILLEFRIENDLY)) |
631 |
else if (option (OPTBRAILLEFRIENDLY)) |
584 |
move (menu->current - menu->top + menu->offset, 0); |
632 |
move (menu->current - menu->top + menu->offset, 0); |
585 |
else |
633 |
else |
586 |
--- 585,591 ---- |
634 |
--- 669,675 ---- |
587 |
menu->oldcurrent = -1; |
635 |
menu->oldcurrent = -1; |
588 |
|
636 |
|
589 |
if (option (OPTARROWCURSOR)) |
637 |
if (option (OPTARROWCURSOR)) |
Link Here
|
592 |
move (menu->current - menu->top + menu->offset, 0); |
640 |
move (menu->current - menu->top + menu->offset, 0); |
593 |
else |
641 |
else |
594 |
*************** |
642 |
*************** |
595 |
*** 1011,1016 **** |
643 |
*** 1095,1100 **** |
596 |
--- 1027,1033 ---- |
644 |
--- 1111,1117 ---- |
597 |
break; |
645 |
break; |
598 |
|
646 |
|
599 |
CHECK_MSGCOUNT; |
647 |
CHECK_MSGCOUNT; |
Link Here
|
602 |
{ |
650 |
{ |
603 |
int oldvcount = Context->vcount; |
651 |
int oldvcount = Context->vcount; |
604 |
*************** |
652 |
*************** |
605 |
*** 1070,1075 **** |
653 |
*** 1154,1159 **** |
606 |
--- 1087,1093 ---- |
654 |
--- 1171,1177 ---- |
607 |
menu->redraw = REDRAW_FULL; |
655 |
menu->redraw = REDRAW_FULL; |
608 |
break; |
656 |
break; |
609 |
|
657 |
|
Link Here
|
612 |
case OP_MAIN_NEXT_UNREAD_MAILBOX: |
660 |
case OP_MAIN_NEXT_UNREAD_MAILBOX: |
613 |
|
661 |
|
614 |
*************** |
662 |
*************** |
615 |
*** 1101,1107 **** |
663 |
*** 1185,1191 **** |
616 |
{ |
664 |
{ |
617 |
mutt_buffy (buf, sizeof (buf)); |
665 |
mutt_buffy (buf, sizeof (buf)); |
618 |
|
666 |
|
Link Here
|
620 |
{ |
668 |
{ |
621 |
if (menu->menu == MENU_PAGER) |
669 |
if (menu->menu == MENU_PAGER) |
622 |
{ |
670 |
{ |
623 |
--- 1119,1129 ---- |
671 |
--- 1203,1213 ---- |
624 |
{ |
672 |
{ |
625 |
mutt_buffy (buf, sizeof (buf)); |
673 |
mutt_buffy (buf, sizeof (buf)); |
626 |
|
674 |
|
Link Here
|
633 |
if (menu->menu == MENU_PAGER) |
681 |
if (menu->menu == MENU_PAGER) |
634 |
{ |
682 |
{ |
635 |
*************** |
683 |
*************** |
636 |
*** 1119,1124 **** |
684 |
*** 1203,1208 **** |
637 |
--- 1141,1147 ---- |
685 |
--- 1225,1231 ---- |
638 |
} |
686 |
} |
639 |
|
687 |
|
640 |
mutt_expand_path (buf, sizeof (buf)); |
688 |
mutt_expand_path (buf, sizeof (buf)); |
Link Here
|
643 |
{ |
691 |
{ |
644 |
mutt_error (_("%s is not a mailbox."), buf); |
692 |
mutt_error (_("%s is not a mailbox."), buf); |
645 |
*************** |
693 |
*************** |
646 |
*** 2209,2214 **** |
694 |
*** 2293,2298 **** |
647 |
--- 2232,2243 ---- |
695 |
--- 2316,2327 ---- |
648 |
mutt_what_key(); |
696 |
mutt_what_key(); |
649 |
break; |
697 |
break; |
650 |
|
698 |
|
Link Here
|
657 |
default: |
705 |
default: |
658 |
if (menu->menu == MENU_MAIN) |
706 |
if (menu->menu == MENU_MAIN) |
659 |
km_error_key (MENU_MAIN); |
707 |
km_error_key (MENU_MAIN); |
660 |
*** mutt-1.5.23-orig/flags.c 2014-03-12 11:03:45.000000000 -0500 |
708 |
*** mutt-1.5.24-orig/flags.c 2015-08-30 12:06:38.000000000 -0500 |
661 |
--- mutt-1.5.23/flags.c 2014-04-11 10:14:01.000000000 -0500 |
709 |
--- mutt-1.5.24/flags.c 2015-09-16 23:18:13.000000000 -0500 |
662 |
*************** |
710 |
*************** |
663 |
*** 22,29 **** |
711 |
*** 22,29 **** |
664 |
--- 22,31 ---- |
712 |
--- 22,31 ---- |
Link Here
|
682 |
} |
730 |
} |
683 |
|
731 |
|
684 |
void mutt_tag_set_flag (int flag, int bf) |
732 |
void mutt_tag_set_flag (int flag, int bf) |
685 |
*** mutt-1.5.23-orig/functions.h 2014-03-12 11:03:45.000000000 -0500 |
733 |
*** mutt-1.5.24-orig/functions.h 2015-08-30 12:06:38.000000000 -0500 |
686 |
--- mutt-1.5.23/functions.h 2014-04-11 10:14:01.000000000 -0500 |
734 |
--- mutt-1.5.24/functions.h 2015-09-16 23:18:13.000000000 -0500 |
687 |
*************** |
735 |
*************** |
688 |
*** 169,174 **** |
736 |
*** 169,174 **** |
689 |
--- 169,179 ---- |
737 |
--- 169,179 ---- |
Link Here
|
712 |
{ NULL, 0, NULL } |
760 |
{ NULL, 0, NULL } |
713 |
}; |
761 |
}; |
714 |
|
762 |
|
715 |
*** mutt-1.5.23-orig/globals.h 2014-03-12 11:06:17.000000000 -0500 |
763 |
*** mutt-1.5.24-orig/globals.h 2015-08-30 12:06:38.000000000 -0500 |
716 |
--- mutt-1.5.23/globals.h 2014-04-11 10:14:01.000000000 -0500 |
764 |
--- mutt-1.5.24/globals.h 2015-09-16 23:18:13.000000000 -0500 |
717 |
*************** |
765 |
*************** |
718 |
*** 117,122 **** |
766 |
*** 118,123 **** |
719 |
--- 117,125 ---- |
767 |
--- 118,126 ---- |
720 |
WHERE char *SendCharset; |
768 |
WHERE char *SendCharset; |
721 |
WHERE char *Sendmail; |
769 |
WHERE char *Sendmail; |
722 |
WHERE char *Shell; |
770 |
WHERE char *Shell; |
Link Here
|
727 |
WHERE char *SimpleSearch; |
775 |
WHERE char *SimpleSearch; |
728 |
#if USE_SMTP |
776 |
#if USE_SMTP |
729 |
*************** |
777 |
*************** |
730 |
*** 208,213 **** |
778 |
*** 213,218 **** |
731 |
--- 211,219 ---- |
779 |
--- 216,224 ---- |
732 |
WHERE short ScoreThresholdRead; |
780 |
WHERE short ScoreThresholdRead; |
733 |
WHERE short ScoreThresholdFlag; |
781 |
WHERE short ScoreThresholdFlag; |
734 |
|
782 |
|
Link Here
|
738 |
#ifdef USE_IMAP |
786 |
#ifdef USE_IMAP |
739 |
WHERE short ImapKeepalive; |
787 |
WHERE short ImapKeepalive; |
740 |
WHERE short ImapPipelineDepth; |
788 |
WHERE short ImapPipelineDepth; |
741 |
*** mutt-1.5.23-orig/handler.c.orig 2015-09-10 09:34:53.000000000 +0200 |
789 |
*** mutt-1.5.24-orig/handler.c 2015-08-30 12:06:38.000000000 -0500 |
742 |
--- mutt-1.5.23/handler.c 2015-09-10 09:58:03.000000000 +0200 |
790 |
--- mutt-1.5.24/handler.c 2015-09-16 23:18:13.000000000 -0500 |
743 |
@@ -1625,6 +1625,11 @@ |
791 |
*************** |
744 |
int decode = 0; |
792 |
*** 1603,1608 **** |
745 |
int rc = 0; |
793 |
--- 1603,1613 ---- |
746 |
|
794 |
|
747 |
+#ifdef HAVE_FMEMOPEN |
795 |
fseeko (s->fpin, b->offset, 0); |
748 |
+ char *temp; |
796 |
|
749 |
+ size_t tempsize; |
797 |
+ #ifdef HAVE_FMEMOPEN |
750 |
+#endif |
798 |
+ char *temp; |
751 |
+ |
799 |
+ size_t tempsize; |
752 |
fseeko (s->fpin, b->offset, 0); |
800 |
+ #endif |
753 |
|
801 |
+ |
754 |
/* see if we need to decode this part before processing it */ |
802 |
/* see if we need to decode this part before processing it */ |
755 |
@@ -1642,6 +1647,14 @@ |
803 |
if (b->encoding == ENCBASE64 || b->encoding == ENCQUOTEDPRINTABLE || |
756 |
{ |
804 |
b->encoding == ENCUUENCODED || plaintext || |
757 |
/* decode to a tempfile, saving the original destination */ |
805 |
*************** |
758 |
fp = s->fpout; |
806 |
*** 1618,1623 **** |
759 |
+#ifdef HAVE_FMEMOPEN |
807 |
--- 1623,1636 ---- |
760 |
+ if ((s->fpout = open_memstream(&temp, &tempsize)) == NULL) |
808 |
{ |
761 |
+ { |
809 |
/* decode to a tempfile, saving the original destination */ |
762 |
+ mutt_error _("Unable to open memory stream!"); |
810 |
fp = s->fpout; |
763 |
+ dprint (1, (debugfile, "Can't open memory stream.\n")); |
811 |
+ #ifdef HAVE_FMEMOPEN |
764 |
+ goto bail; |
812 |
+ if ((s->fpout = open_memstream(&temp, &tempsize)) == NULL) |
765 |
+ } |
813 |
+ { |
766 |
+#else |
814 |
+ mutt_error _("Unable to open memory stream!"); |
767 |
mutt_mktemp (tempfile, sizeof (tempfile)); |
815 |
+ dprint (1, (debugfile, "Can't open memory stream.\n")); |
768 |
if ((s->fpout = safe_fopen (tempfile, "w")) == NULL) |
816 |
+ return -1; |
769 |
{ |
817 |
+ } |
770 |
@@ -1649,6 +1662,7 @@ |
818 |
+ #else |
771 |
dprint (1, (debugfile, "Can't open %s.\n", tempfile)); |
819 |
mutt_mktemp (tempfile, sizeof (tempfile)); |
772 |
return -1; |
820 |
if ((s->fpout = safe_fopen (tempfile, "w")) == NULL) |
773 |
} |
821 |
{ |
774 |
+#endif |
822 |
*************** |
775 |
/* decoding the attachment changes the size and offset, so save a copy |
823 |
*** 1625,1630 **** |
776 |
* of the "real" values now, and restore them after processing |
824 |
--- 1638,1644 ---- |
777 |
*/ |
825 |
dprint (1, (debugfile, "Can't open %s.\n", tempfile)); |
778 |
@@ -1677,8 +1691,19 @@ |
826 |
return -1; |
779 |
/* restore final destination and substitute the tempfile for input */ |
827 |
} |
780 |
s->fpout = fp; |
828 |
+ #endif |
781 |
fp = s->fpin; |
829 |
/* decoding the attachment changes the size and offset, so save a copy |
782 |
+#ifdef HAVE_FMEMOPEN |
830 |
* of the "real" values now, and restore them after processing |
783 |
+ if(tempsize) |
831 |
*/ |
784 |
+ s->fpin = fmemopen(temp, tempsize, "r"); |
832 |
*************** |
785 |
+ else /* fmemopen cannot handle zero-length buffers */ |
833 |
*** 1653,1661 **** |
786 |
+ s->fpin = safe_fopen ("/dev/null", "r"); |
834 |
/* restore final destination and substitute the tempfile for input */ |
787 |
+ if(s->fpin == NULL) { |
835 |
s->fpout = fp; |
788 |
+ mutt_perror("failed to re-open memstream!"); |
836 |
fp = s->fpin; |
789 |
+ return (-1); |
837 |
s->fpin = fopen (tempfile, "r"); |
790 |
+ } |
838 |
unlink (tempfile); |
791 |
+#else |
839 |
! |
792 |
s->fpin = fopen (tempfile, "r"); |
840 |
/* restore the prefix */ |
793 |
unlink (tempfile); |
841 |
s->prefix = savePrefix; |
794 |
+#endif |
842 |
} |
795 |
|
843 |
--- 1667,1685 ---- |
796 |
/* restore the prefix */ |
844 |
/* restore final destination and substitute the tempfile for input */ |
797 |
s->prefix = savePrefix; |
845 |
s->fpout = fp; |
798 |
@@ -1704,9 +1729,14 @@ |
846 |
fp = s->fpin; |
799 |
|
847 |
+ #ifdef HAVE_FMEMOPEN |
800 |
/* restore the original source stream */ |
848 |
+ if(tempsize) |
801 |
safe_fclose (&s->fpin); |
849 |
+ s->fpin = fmemopen(temp, tempsize, "r"); |
802 |
+#ifdef HAVE_FMEMOPEN |
850 |
+ else /* fmemopen cannot handle zero-length buffers */ |
803 |
+ if(tempsize) |
851 |
+ s->fpin = safe_fopen ("/dev/null", "r"); |
804 |
+ FREE(&temp); |
852 |
+ if(s->fpin == NULL) { |
805 |
+#endif |
853 |
+ mutt_perror("failed to re-open memstream!"); |
806 |
s->fpin = fp; |
854 |
+ return (-1); |
807 |
} |
855 |
+ } |
808 |
} |
856 |
+ #else |
809 |
+ bail: |
857 |
s->fpin = fopen (tempfile, "r"); |
810 |
s->flags |= M_FIRSTDONE; |
858 |
unlink (tempfile); |
811 |
|
859 |
! #endif |
812 |
return rc; |
860 |
/* restore the prefix */ |
813 |
@@ -1743,6 +1773,7 @@ |
861 |
s->prefix = savePrefix; |
814 |
handler_t handler = NULL; |
862 |
} |
815 |
int rc = 0; |
863 |
*************** |
816 |
|
864 |
*** 1680,1685 **** |
817 |
+ |
865 |
--- 1704,1713 ---- |
818 |
int oflags = s->flags; |
866 |
|
819 |
|
867 |
/* restore the original source stream */ |
820 |
/* first determine which handler to use to process this part */ |
868 |
safe_fclose (&s->fpin); |
821 |
*** mutt-1.5.23-orig/init.h 2014-03-12 11:06:17.000000000 -0500 |
869 |
+ #ifdef HAVE_FMEMOPEN |
822 |
--- mutt-1.5.23/init.h 2014-04-11 10:14:01.000000000 -0500 |
870 |
+ if(tempsize) |
|
|
871 |
+ FREE(&temp); |
872 |
+ #endif |
873 |
s->fpin = fp; |
874 |
} |
875 |
} |
876 |
*** mutt-1.5.24-orig/init.h 2015-08-30 12:06:38.000000000 -0500 |
877 |
--- mutt-1.5.24/init.h 2015-09-16 23:18:13.000000000 -0500 |
823 |
*************** |
878 |
*************** |
824 |
*** 1966,1971 **** |
879 |
*** 2016,2021 **** |
825 |
--- 1966,2019 ---- |
880 |
--- 2016,2069 ---- |
826 |
** not used. |
881 |
** not used. |
827 |
** (PGP only) |
882 |
** (PGP only) |
828 |
*/ |
883 |
*/ |
Link Here
|
853 |
+ ** .pp |
908 |
+ ** .pp |
854 |
+ ** The width of the sidebar. |
909 |
+ ** The width of the sidebar. |
855 |
+ */ |
910 |
+ */ |
856 |
+ { "sidebar_shortpath", DT_BOOL, R_BOTH, OPTSIDEBARSHORTPATH, 1 }, |
911 |
+ { "sidebar_shortpath", DT_BOOL, R_BOTH, OPTSIDEBARSHORTPATH, 0 }, |
857 |
+ /* |
912 |
+ /* |
858 |
+ ** .pp |
913 |
+ ** .pp |
859 |
+ ** Should the sidebar shorten the path showed. |
914 |
+ ** Should the sidebar shorten the path showed. |
Link Here
|
877 |
{ "pgp_use_gpg_agent", DT_BOOL, R_NONE, OPTUSEGPGAGENT, 0}, |
932 |
{ "pgp_use_gpg_agent", DT_BOOL, R_NONE, OPTUSEGPGAGENT, 0}, |
878 |
/* |
933 |
/* |
879 |
** .pp |
934 |
** .pp |
880 |
*** mutt-1.5.23-orig/mailbox.h 2014-03-12 11:03:45.000000000 -0500 |
935 |
*** mutt-1.5.24-orig/mailbox.h 2015-08-30 12:06:38.000000000 -0500 |
881 |
--- mutt-1.5.23/mailbox.h 2014-04-11 10:14:01.000000000 -0500 |
936 |
--- mutt-1.5.24/mailbox.h 2015-09-16 23:18:13.000000000 -0500 |
882 |
*************** |
937 |
*************** |
883 |
*** 27,32 **** |
938 |
*** 27,32 **** |
884 |
--- 27,33 ---- |
939 |
--- 27,33 ---- |
Link Here
|
888 |
+ #define M_PEEK (1<<5) /* revert atime back after taking a look (if applicable) */ |
943 |
+ #define M_PEEK (1<<5) /* revert atime back after taking a look (if applicable) */ |
889 |
|
944 |
|
890 |
/* mx_open_new_message() */ |
945 |
/* mx_open_new_message() */ |
891 |
#define M_ADD_FROM 1 /* add a From_ line */ |
946 |
#define M_ADD_FROM (1<<0) /* add a From_ line */ |
892 |
*** mutt-1.5.23-orig/main.c 2014-03-12 11:06:17.000000000 -0500 |
947 |
*** mutt-1.5.24-orig/main.c 2015-08-30 12:06:38.000000000 -0500 |
893 |
--- mutt-1.5.23/main.c 2014-04-11 10:14:01.000000000 -0500 |
948 |
--- mutt-1.5.24/main.c 2015-09-16 23:18:13.000000000 -0500 |
894 |
*************** |
949 |
*************** |
895 |
*** 50,55 **** |
950 |
*** 50,55 **** |
896 |
--- 50,56 ---- |
951 |
--- 50,56 ---- |
Link Here
|
919 |
char *includeFile = NULL; |
974 |
char *includeFile = NULL; |
920 |
char *draftFile = NULL; |
975 |
char *draftFile = NULL; |
921 |
*************** |
976 |
*************** |
922 |
*** 1025,1030 **** |
977 |
*** 1036,1041 **** |
923 |
--- 1026,1038 ---- |
978 |
--- 1037,1049 ---- |
924 |
strfcpy (folder, NONULL(Spoolfile), sizeof (folder)); |
979 |
strfcpy (folder, NONULL(Spoolfile), sizeof (folder)); |
925 |
mutt_expand_path (folder, sizeof (folder)); |
980 |
mutt_expand_path (folder, sizeof (folder)); |
926 |
|
981 |
|
Link Here
|
935 |
mutt_str_replace (&LastFolder, folder); |
990 |
mutt_str_replace (&LastFolder, folder); |
936 |
|
991 |
|
937 |
*************** |
992 |
*************** |
938 |
*** 1047,1052 **** |
993 |
*** 1058,1063 **** |
939 |
--- 1055,1061 ---- |
994 |
--- 1066,1072 ---- |
940 |
if((Context = mx_open_mailbox (folder, ((flags & M_RO) || option (OPTREADONLY)) ? M_READONLY : 0, NULL)) |
995 |
if((Context = mx_open_mailbox (folder, ((flags & M_RO) || option (OPTREADONLY)) ? M_READONLY : 0, NULL)) |
941 |
|| !explicit_folder) |
996 |
|| !explicit_folder) |
942 |
{ |
997 |
{ |
Link Here
|
944 |
mutt_index_menu (); |
999 |
mutt_index_menu (); |
945 |
if (Context) |
1000 |
if (Context) |
946 |
FREE (&Context); |
1001 |
FREE (&Context); |
947 |
*** mutt-1.5.23-orig/Makefile.am 2014-03-12 11:03:44.000000000 -0500 |
1002 |
*** mutt-1.5.24-orig/Makefile.am 2015-08-30 12:06:38.000000000 -0500 |
948 |
--- mutt-1.5.23/Makefile.am 2014-04-11 10:14:01.000000000 -0500 |
1003 |
--- mutt-1.5.24/Makefile.am 2015-09-16 23:18:13.000000000 -0500 |
949 |
*************** |
1004 |
*************** |
950 |
*** 32,37 **** |
1005 |
*** 33,38 **** |
951 |
--- 32,38 ---- |
1006 |
--- 33,39 ---- |
952 |
rfc822.c rfc1524.c rfc2047.c rfc2231.c rfc3676.c \ |
1007 |
rfc822.c rfc1524.c rfc2047.c rfc2231.c rfc3676.c \ |
953 |
score.c send.c sendlib.c signal.c sort.c \ |
1008 |
score.c send.c sendlib.c signal.c sort.c \ |
954 |
status.c system.c thread.c charset.c history.c lib.c \ |
1009 |
status.c system.c thread.c charset.c history.c lib.c \ |
Link Here
|
956 |
muttlib.c editmsg.c mbyte.c \ |
1011 |
muttlib.c editmsg.c mbyte.c \ |
957 |
url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c |
1012 |
url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c |
958 |
|
1013 |
|
959 |
*** mutt-1.5.23-orig/Makefile.in 2014-03-12 11:26:44.000000000 -0500 |
1014 |
*** mutt-1.5.24-orig/Makefile.in 2015-08-30 12:24:26.000000000 -0500 |
960 |
--- mutt-1.5.23/Makefile.in 2014-04-12 12:12:38.000000000 -0500 |
1015 |
--- mutt-1.5.24/Makefile.in 2015-09-16 23:18:13.000000000 -0500 |
961 |
*************** |
1016 |
*************** |
962 |
*** 129,135 **** |
1017 |
*** 83,92 **** |
|
|
1018 |
$(srcdir)/Makefile.am $(top_srcdir)/configure \ |
1019 |
$(am__configure_deps) $(srcdir)/config.h.in \ |
1020 |
$(top_srcdir)/intl/Makefile.in $(srcdir)/hcachever.sh.in \ |
1021 |
! $(srcdir)/muttbug.sh.in strtok_r.c strcasecmp.c regex.c \ |
1022 |
! snprintf.c wcscasecmp.c strcasestr.c setenv.c mkdtemp.c \ |
1023 |
! strsep.c strdup.c depcomp ABOUT-NLS ChangeLog INSTALL NEWS \ |
1024 |
! README TODO compile config.guess config.sub install-sh missing |
1025 |
EXTRA_PROGRAMS = mutt_dotlock$(EXEEXT) pgpring$(EXEEXT) \ |
1026 |
pgpewrap$(EXEEXT) mutt_md5$(EXEEXT) |
1027 |
bin_PROGRAMS = mutt$(EXEEXT) $(DOTLOCK_TARGET) $(PGPAUX_TARGET) |
1028 |
--- 83,92 ---- |
1029 |
$(srcdir)/Makefile.am $(top_srcdir)/configure \ |
1030 |
$(am__configure_deps) $(srcdir)/config.h.in \ |
1031 |
$(top_srcdir)/intl/Makefile.in $(srcdir)/hcachever.sh.in \ |
1032 |
! $(srcdir)/muttbug.sh.in snprintf.c strtok_r.c regex.c strdup.c \ |
1033 |
! strcasecmp.c setenv.c strcasestr.c wcscasecmp.c mkdtemp.c \ |
1034 |
! strsep.c depcomp ABOUT-NLS ChangeLog INSTALL NEWS README TODO \ |
1035 |
! compile config.guess config.sub install-sh missing |
1036 |
EXTRA_PROGRAMS = mutt_dotlock$(EXEEXT) pgpring$(EXEEXT) \ |
1037 |
pgpewrap$(EXEEXT) mutt_md5$(EXEEXT) |
1038 |
bin_PROGRAMS = mutt$(EXEEXT) $(DOTLOCK_TARGET) $(PGPAUX_TARGET) |
1039 |
*************** |
1040 |
*** 128,136 **** |
1041 |
score.$(OBJEXT) send.$(OBJEXT) sendlib.$(OBJEXT) \ |
1042 |
signal.$(OBJEXT) sort.$(OBJEXT) status.$(OBJEXT) \ |
963 |
system.$(OBJEXT) thread.$(OBJEXT) charset.$(OBJEXT) \ |
1043 |
system.$(OBJEXT) thread.$(OBJEXT) charset.$(OBJEXT) \ |
964 |
history.$(OBJEXT) lib.$(OBJEXT) muttlib.$(OBJEXT) \ |
1044 |
! history.$(OBJEXT) lib.$(OBJEXT) muttlib.$(OBJEXT) \ |
965 |
editmsg.$(OBJEXT) mbyte.$(OBJEXT) url.$(OBJEXT) \ |
1045 |
! editmsg.$(OBJEXT) mbyte.$(OBJEXT) url.$(OBJEXT) \ |
966 |
! ascii.$(OBJEXT) crypt-mod.$(OBJEXT) safe_asprintf.$(OBJEXT) |
1046 |
! ascii.$(OBJEXT) crypt-mod.$(OBJEXT) safe_asprintf.$(OBJEXT) |
967 |
am__objects_1 = |
1047 |
am__objects_1 = |
968 |
am__objects_2 = patchlist.$(OBJEXT) conststrings.$(OBJEXT) \ |
1048 |
am__objects_2 = patchlist.$(OBJEXT) conststrings.$(OBJEXT) \ |
969 |
$(am__objects_1) |
1049 |
$(am__objects_1) |
970 |
--- 129,136 ---- |
1050 |
--- 128,137 ---- |
|
|
1051 |
score.$(OBJEXT) send.$(OBJEXT) sendlib.$(OBJEXT) \ |
1052 |
signal.$(OBJEXT) sort.$(OBJEXT) status.$(OBJEXT) \ |
971 |
system.$(OBJEXT) thread.$(OBJEXT) charset.$(OBJEXT) \ |
1053 |
system.$(OBJEXT) thread.$(OBJEXT) charset.$(OBJEXT) \ |
972 |
history.$(OBJEXT) lib.$(OBJEXT) muttlib.$(OBJEXT) \ |
1054 |
! history.$(OBJEXT) lib.$(OBJEXT) sidebar.$(OBJEXT) \ |
973 |
editmsg.$(OBJEXT) mbyte.$(OBJEXT) url.$(OBJEXT) \ |
1055 |
! muttlib.$(OBJEXT) editmsg.$(OBJEXT) mbyte.$(OBJEXT) \ |
974 |
! ascii.$(OBJEXT) crypt-mod.$(OBJEXT) safe_asprintf.$(OBJEXT) \ |
1056 |
! url.$(OBJEXT) ascii.$(OBJEXT) crypt-mod.$(OBJEXT) \ |
975 |
! sidebar.$(OBJEXT) |
1057 |
! safe_asprintf.$(OBJEXT) |
976 |
am__objects_1 = |
1058 |
am__objects_1 = |
977 |
am__objects_2 = patchlist.$(OBJEXT) conststrings.$(OBJEXT) \ |
1059 |
am__objects_2 = patchlist.$(OBJEXT) conststrings.$(OBJEXT) \ |
978 |
$(am__objects_1) |
1060 |
$(am__objects_1) |
979 |
*************** |
1061 |
*************** |
980 |
*** 468,474 **** |
1062 |
*** 474,479 **** |
981 |
score.c send.c sendlib.c signal.c sort.c \ |
1063 |
--- 475,481 ---- |
982 |
status.c system.c thread.c charset.c history.c lib.c \ |
1064 |
rfc822.c rfc1524.c rfc2047.c rfc2231.c rfc3676.c \ |
983 |
muttlib.c editmsg.c mbyte.c \ |
|
|
984 |
! url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c |
985 |
|
986 |
nodist_mutt_SOURCES = $(BUILT_SOURCES) |
987 |
mutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(MUTTLIBS) \ |
988 |
--- 469,476 ---- |
989 |
score.c send.c sendlib.c signal.c sort.c \ |
1065 |
score.c send.c sendlib.c signal.c sort.c \ |
990 |
status.c system.c thread.c charset.c history.c lib.c \ |
1066 |
status.c system.c thread.c charset.c history.c lib.c \ |
|
|
1067 |
+ sidebar.c \ |
991 |
muttlib.c editmsg.c mbyte.c \ |
1068 |
muttlib.c editmsg.c mbyte.c \ |
992 |
! url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c \ |
1069 |
url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c |
993 |
! sidebar.c |
|
|
994 |
|
1070 |
|
995 |
nodist_mutt_SOURCES = $(BUILT_SOURCES) |
|
|
996 |
mutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(MUTTLIBS) \ |
997 |
*************** |
1071 |
*************** |
998 |
*** 500,506 **** |
1072 |
*** 804,809 **** |
999 |
README.SSL smime.h group.h \ |
1073 |
--- 806,812 ---- |
1000 |
muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \ |
1074 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/send.Po@am__quote@ |
1001 |
ChangeLog mkchangelog.sh mutt_idna.h \ |
1075 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendlib.Po@am__quote@ |
1002 |
! snprintf.c regex.c crypt-gpgme.h hcachever.sh.in \ |
1076 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1.Po@am__quote@ |
1003 |
txt2c.c txt2c.sh version.sh check_sec.sh |
1077 |
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sidebar.Po@am__quote@ |
1004 |
|
1078 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal.Po@am__quote@ |
1005 |
EXTRA_SCRIPTS = smime_keys |
1079 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smime.Po@am__quote@ |
1006 |
--- 502,508 ---- |
1080 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp.Po@am__quote@ |
1007 |
README.SSL smime.h group.h \ |
1081 |
*** mutt-1.5.24-orig/mbox.c 2015-08-30 12:06:38.000000000 -0500 |
1008 |
muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \ |
1082 |
--- mutt-1.5.24/mbox.c 2015-09-16 23:18:13.000000000 -0500 |
1009 |
ChangeLog mkchangelog.sh mutt_idna.h \ |
|
|
1010 |
! snprintf.c regex.c crypt-gpgme.h sidebar.h hcachever.sh.in \ |
1011 |
txt2c.c txt2c.sh version.sh check_sec.sh |
1012 |
|
1013 |
EXTRA_SCRIPTS = smime_keys |
1014 |
*** mutt-1.5.23-orig/mbox.c 2014-03-12 11:03:45.000000000 -0500 |
1015 |
--- mutt-1.5.23/mbox.c 2014-04-11 10:14:01.000000000 -0500 |
1016 |
*************** |
1083 |
*************** |
1017 |
*** 100,105 **** |
1084 |
*** 100,105 **** |
1018 |
--- 100,106 ---- |
1085 |
--- 100,106 ---- |
Link Here
|
1033 |
|
1100 |
|
1034 |
#ifdef NFS_ATTRIBUTE_HACK |
1101 |
#ifdef NFS_ATTRIBUTE_HACK |
1035 |
if (sb.st_mtime > sb.st_atime) |
1102 |
if (sb.st_mtime > sb.st_atime) |
1036 |
*** mutt-1.5.23-orig/menu.c 2014-03-12 11:03:45.000000000 -0500 |
1103 |
*** mutt-1.5.24-orig/menu.c 2015-08-30 12:06:38.000000000 -0500 |
1037 |
--- mutt-1.5.23/menu.c 2014-04-12 21:31:16.000000000 -0500 |
1104 |
--- mutt-1.5.24/menu.c 2015-09-16 23:18:13.000000000 -0500 |
1038 |
*************** |
1105 |
*************** |
1039 |
*** 24,29 **** |
1106 |
*** 24,29 **** |
1040 |
--- 24,30 ---- |
1107 |
--- 24,30 ---- |
Link Here
|
1203 |
else if (option (OPTBRAILLEFRIENDLY)) |
1270 |
else if (option (OPTBRAILLEFRIENDLY)) |
1204 |
move (menu->current - menu->top + menu->offset, 0); |
1271 |
move (menu->current - menu->top + menu->offset, 0); |
1205 |
else |
1272 |
else |
1206 |
*** mutt-1.5.23-orig/mh.c 2014-03-12 11:03:45.000000000 -0500 |
1273 |
*** mutt-1.5.24-orig/mh.c 2015-08-30 12:06:38.000000000 -0500 |
1207 |
--- mutt-1.5.23/mh.c 2014-04-11 11:04:59.000000000 -0500 |
1274 |
--- mutt-1.5.24/mh.c 2015-09-16 23:18:13.000000000 -0500 |
1208 |
*************** |
1275 |
*************** |
1209 |
*** 295,300 **** |
1276 |
*** 295,300 **** |
1210 |
--- 295,326 ---- |
1277 |
--- 295,326 ---- |
Link Here
|
1240 |
static int mh_mkstemp (CONTEXT * dest, FILE ** fp, char **tgt) |
1307 |
static int mh_mkstemp (CONTEXT * dest, FILE ** fp, char **tgt) |
1241 |
{ |
1308 |
{ |
1242 |
int fd; |
1309 |
int fd; |
1243 |
*** mutt-1.5.23-orig/mutt_curses.h.orig 2015-08-30 19:06:38.000000000 +0200 |
1310 |
*** mutt-1.5.24-orig/mutt_curses.h 2015-08-30 12:06:38.000000000 -0500 |
1244 |
--- mutt-1.5.23/mutt_curses.h 2015-09-10 09:42:34.000000000 +0200 |
1311 |
--- mutt-1.5.24/mutt_curses.h 2015-09-16 23:18:13.000000000 -0500 |
1245 |
@@ -64,6 +64,7 @@ |
1312 |
*************** |
1246 |
#undef lines |
1313 |
*** 64,69 **** |
1247 |
#endif /* lines */ |
1314 |
--- 64,70 ---- |
1248 |
|
1315 |
#undef lines |
1249 |
+#define CLEARLINE_WIN(x) move(x,SidebarWidth), clrtoeol() |
1316 |
#endif /* lines */ |
1250 |
#define CLEARLINE(x) move(x,0), clrtoeol() |
1317 |
|
1251 |
#define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x) |
1318 |
+ #define CLEARLINE_WIN(x) move(x,SidebarWidth), clrtoeol() |
1252 |
#define BEEP() do { if (option (OPTBEEP)) beep(); } while (0) |
1319 |
#define CLEARLINE(x) move(x,0), clrtoeol() |
1253 |
@@ -121,6 +122,8 @@ |
1320 |
#define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x) |
1254 |
MT_COLOR_UNDERLINE, |
1321 |
#define BEEP() do { if (option (OPTBEEP)) beep(); } while (0) |
1255 |
MT_COLOR_INDEX, |
1322 |
*************** |
1256 |
MT_COLOR_PROMPT, |
1323 |
*** 121,126 **** |
1257 |
+ MT_COLOR_NEW, |
1324 |
--- 122,129 ---- |
1258 |
+ MT_COLOR_FLAGGED, |
1325 |
MT_COLOR_UNDERLINE, |
1259 |
MT_COLOR_MAX |
1326 |
MT_COLOR_INDEX, |
1260 |
}; |
1327 |
MT_COLOR_PROMPT, |
1261 |
|
1328 |
+ MT_COLOR_NEW, |
1262 |
*** mutt-1.5.23-orig/mutt_menu.h 2014-03-12 11:06:17.000000000 -0500 |
1329 |
+ MT_COLOR_FLAGGED, |
1263 |
--- mutt-1.5.23/mutt_menu.h 2014-04-11 10:14:01.000000000 -0500 |
1330 |
MT_COLOR_MAX |
|
|
1331 |
}; |
1332 |
|
1333 |
*** mutt-1.5.24-orig/mutt_menu.h 2015-08-30 12:06:38.000000000 -0500 |
1334 |
--- mutt-1.5.24/mutt_menu.h 2015-09-16 23:18:13.000000000 -0500 |
1264 |
*************** |
1335 |
*************** |
1265 |
*** 34,39 **** |
1336 |
*** 34,39 **** |
1266 |
--- 34,40 ---- |
1337 |
--- 34,40 ---- |
Link Here
|
1271 |
|
1342 |
|
1272 |
#define M_MODEFMT "-- Mutt: %s" |
1343 |
#define M_MODEFMT "-- Mutt: %s" |
1273 |
|
1344 |
|
1274 |
*** mutt-1.5.23-orig/mutt.h 2014-03-12 11:06:17.000000000 -0500 |
1345 |
*** mutt-1.5.24-orig/mutt.h 2015-08-30 12:06:38.000000000 -0500 |
1275 |
--- mutt-1.5.23/mutt.h 2014-04-11 10:14:01.000000000 -0500 |
1346 |
--- mutt-1.5.24/mutt.h 2015-09-16 23:18:13.000000000 -0500 |
1276 |
*************** |
1347 |
*************** |
1277 |
*** 421,426 **** |
1348 |
*** 423,428 **** |
1278 |
--- 421,430 ---- |
1349 |
--- 423,432 ---- |
1279 |
OPTSAVEEMPTY, |
1350 |
OPTSAVEEMPTY, |
1280 |
OPTSAVENAME, |
1351 |
OPTSAVENAME, |
1281 |
OPTSCORE, |
1352 |
OPTSCORE, |
Link Here
|
1287 |
OPTSIGONTOP, |
1358 |
OPTSIGONTOP, |
1288 |
OPTSORTRE, |
1359 |
OPTSORTRE, |
1289 |
*************** |
1360 |
*************** |
1290 |
*** 861,866 **** |
1361 |
*** 866,871 **** |
1291 |
--- 865,871 ---- |
1362 |
--- 870,876 ---- |
1292 |
{ |
1363 |
{ |
1293 |
char *path; |
1364 |
char *path; |
1294 |
FILE *fp; |
1365 |
FILE *fp; |
Link Here
|
1297 |
off_t size; |
1368 |
off_t size; |
1298 |
off_t vsize; |
1369 |
off_t vsize; |
1299 |
*************** |
1370 |
*************** |
1300 |
*** 895,900 **** |
1371 |
*** 900,905 **** |
1301 |
--- 900,906 ---- |
1372 |
--- 905,911 ---- |
1302 |
unsigned int quiet : 1; /* inhibit status messages? */ |
1373 |
unsigned int quiet : 1; /* inhibit status messages? */ |
1303 |
unsigned int collapsed : 1; /* are all threads collapsed? */ |
1374 |
unsigned int collapsed : 1; /* are all threads collapsed? */ |
1304 |
unsigned int closing : 1; /* mailbox is being closed */ |
1375 |
unsigned int closing : 1; /* mailbox is being closed */ |
Link Here
|
1306 |
|
1377 |
|
1307 |
/* driver hooks */ |
1378 |
/* driver hooks */ |
1308 |
void *data; /* driver specific data */ |
1379 |
void *data; /* driver specific data */ |
1309 |
*** mutt-1.5.23-orig/muttlib.c 2014-03-12 11:03:45.000000000 -0500 |
1380 |
*** mutt-1.5.24-orig/muttlib.c 2015-08-30 12:06:38.000000000 -0500 |
1310 |
--- mutt-1.5.23/muttlib.c 2014-04-11 10:14:01.000000000 -0500 |
1381 |
--- mutt-1.5.24/muttlib.c 2015-09-16 23:18:13.000000000 -0500 |
1311 |
*************** |
1382 |
*************** |
1312 |
*** 1281,1286 **** |
1383 |
*** 1276,1281 **** |
1313 |
--- 1281,1288 ---- |
1384 |
--- 1276,1283 ---- |
1314 |
pl = pw = 1; |
1385 |
pl = pw = 1; |
1315 |
|
1386 |
|
1316 |
/* see if there's room to add content, else ignore */ |
1387 |
/* see if there's room to add content, else ignore */ |
Link Here
|
1320 |
{ |
1391 |
{ |
1321 |
int pad; |
1392 |
int pad; |
1322 |
*************** |
1393 |
*************** |
1323 |
*** 1324,1329 **** |
1394 |
*** 1319,1324 **** |
1324 |
--- 1326,1377 ---- |
1395 |
--- 1321,1372 ---- |
1325 |
col += wid; |
1396 |
col += wid; |
1326 |
src += pl; |
1397 |
src += pl; |
1327 |
} |
1398 |
} |
Link Here
|
1374 |
break; /* skip rest of input */ |
1445 |
break; /* skip rest of input */ |
1375 |
} |
1446 |
} |
1376 |
else if (ch == '|') |
1447 |
else if (ch == '|') |
1377 |
*** mutt-1.5.23-orig/mx.c 2014-03-12 11:03:45.000000000 -0500 |
1448 |
*** mutt-1.5.24-orig/mx.c 2015-08-30 12:06:38.000000000 -0500 |
1378 |
--- mutt-1.5.23/mx.c 2014-04-11 10:14:01.000000000 -0500 |
1449 |
--- mutt-1.5.24/mx.c 2015-09-16 23:18:13.000000000 -0500 |
1379 |
*************** |
1450 |
*************** |
1380 |
*** 580,585 **** |
1451 |
*** 580,585 **** |
1381 |
--- 580,586 ---- |
1452 |
--- 580,586 ---- |
Link Here
|
1463 |
} |
1534 |
} |
1464 |
|
1535 |
|
1465 |
if (read_msgs && quadoption (OPT_MOVE) != M_NO) |
1536 |
if (read_msgs && quadoption (OPT_MOVE) != M_NO) |
1466 |
*** mutt-1.5.23-orig/mx.h 2014-03-12 11:03:45.000000000 -0500 |
1537 |
*** mutt-1.5.24-orig/mx.h 2015-08-30 12:06:38.000000000 -0500 |
1467 |
--- mutt-1.5.23/mx.h 2014-04-11 11:11:47.000000000 -0500 |
1538 |
--- mutt-1.5.24/mx.h 2015-09-16 23:18:13.000000000 -0500 |
1468 |
*************** |
1539 |
*************** |
1469 |
*** 57,62 **** |
1540 |
*** 57,62 **** |
1470 |
--- 57,63 ---- |
1541 |
--- 57,63 ---- |
Link Here
|
1475 |
int mh_check_empty (const char *); |
1546 |
int mh_check_empty (const char *); |
1476 |
|
1547 |
|
1477 |
int maildir_read_dir (CONTEXT *); |
1548 |
int maildir_read_dir (CONTEXT *); |
1478 |
*** mutt-1.5.23-orig/OPS 2014-03-12 11:03:44.000000000 -0500 |
1549 |
*** mutt-1.5.24-orig/OPS 2015-08-30 12:06:38.000000000 -0500 |
1479 |
--- mutt-1.5.23/OPS 2014-04-11 10:14:01.000000000 -0500 |
1550 |
--- mutt-1.5.24/OPS 2015-09-16 23:18:13.000000000 -0500 |
1480 |
*************** |
1551 |
*************** |
1481 |
*** 179,181 **** |
1552 |
*** 179,181 **** |
1482 |
--- 179,186 ---- |
1553 |
--- 179,186 ---- |
Link Here
|
1488 |
+ OP_SIDEBAR_NEXT "go down to next mailbox" |
1559 |
+ OP_SIDEBAR_NEXT "go down to next mailbox" |
1489 |
+ OP_SIDEBAR_PREV "go to previous mailbox" |
1560 |
+ OP_SIDEBAR_PREV "go to previous mailbox" |
1490 |
+ OP_SIDEBAR_OPEN "open hilighted mailbox" |
1561 |
+ OP_SIDEBAR_OPEN "open hilighted mailbox" |
1491 |
*** mutt-1.5.23-orig/pager.c 2014-03-12 11:06:17.000000000 -0500 |
1562 |
*** mutt-1.5.24-orig/pager.c 2015-08-30 12:06:38.000000000 -0500 |
1492 |
--- mutt-1.5.23/pager.c 2014-04-12 21:53:15.000000000 -0500 |
1563 |
--- mutt-1.5.24/pager.c 2015-09-16 23:18:13.000000000 -0500 |
1493 |
*************** |
1564 |
*************** |
1494 |
*** 29,34 **** |
1565 |
*** 29,34 **** |
1495 |
--- 29,35 ---- |
1566 |
--- 29,35 ---- |
Link Here
|
1586 |
! mutt_paddstr (COLS, bn); |
1657 |
! mutt_paddstr (COLS, bn); |
1587 |
} |
1658 |
} |
1588 |
NORMAL_COLOR; |
1659 |
NORMAL_COLOR; |
1589 |
} |
1660 |
if (option(OPTTSENABLED) && TSSupported) |
1590 |
|
1661 |
{ |
1591 |
--- 1793,1831 ---- |
1662 |
--- 1793,1831 ---- |
1592 |
hfi.ctx = Context; |
1663 |
hfi.ctx = Context; |
1593 |
hfi.pager_progress = pager_progress_str; |
1664 |
hfi.pager_progress = pager_progress_str; |
Link Here
|
1626 |
+ if(!option(OPTSTATUSONTOP) || PagerIndexLines == 0) |
1697 |
+ if(!option(OPTSTATUSONTOP) || PagerIndexLines == 0) |
1627 |
+ DrawFullLine = 0; /* reset */ |
1698 |
+ DrawFullLine = 0; /* reset */ |
1628 |
NORMAL_COLOR; |
1699 |
NORMAL_COLOR; |
1629 |
} |
1700 |
if (option(OPTTSENABLED) && TSSupported) |
1630 |
|
1701 |
{ |
1631 |
*************** |
1702 |
*************** |
1632 |
*** 1819,1834 **** |
1703 |
*** 1826,1841 **** |
1633 |
/* redraw the pager_index indicator, because the |
1704 |
/* redraw the pager_index indicator, because the |
1634 |
* flags for this message might have changed. */ |
1705 |
* flags for this message might have changed. */ |
1635 |
menu_redraw_current (index); |
1706 |
menu_redraw_current (index); |
Link Here
|
1646 |
redraw = 0; |
1717 |
redraw = 0; |
1647 |
|
1718 |
|
1648 |
if (option(OPTBRAILLEFRIENDLY)) { |
1719 |
if (option(OPTBRAILLEFRIENDLY)) { |
1649 |
--- 1834,1855 ---- |
1720 |
--- 1841,1862 ---- |
1650 |
/* redraw the pager_index indicator, because the |
1721 |
/* redraw the pager_index indicator, because the |
1651 |
* flags for this message might have changed. */ |
1722 |
* flags for this message might have changed. */ |
1652 |
menu_redraw_current (index); |
1723 |
menu_redraw_current (index); |
Link Here
|
1670 |
|
1741 |
|
1671 |
if (option(OPTBRAILLEFRIENDLY)) { |
1742 |
if (option(OPTBRAILLEFRIENDLY)) { |
1672 |
*************** |
1743 |
*************** |
1673 |
*** 2763,2768 **** |
1744 |
*** 2770,2775 **** |
1674 |
--- 2784,2796 ---- |
1745 |
--- 2791,2803 ---- |
1675 |
mutt_what_key (); |
1746 |
mutt_what_key (); |
1676 |
break; |
1747 |
break; |
1677 |
|
1748 |
|
Link Here
|
1685 |
default: |
1756 |
default: |
1686 |
ch = -1; |
1757 |
ch = -1; |
1687 |
break; |
1758 |
break; |
1688 |
*** mutt-1.5.23-orig/pattern.c 2014-03-12 11:03:45.000000000 -0500 |
1759 |
*** mutt-1.5.24-orig/pattern.c 2015-08-30 12:06:38.000000000 -0500 |
1689 |
--- mutt-1.5.23/pattern.c 2014-04-11 10:14:01.000000000 -0500 |
1760 |
--- mutt-1.5.24/pattern.c 2015-09-16 23:18:13.000000000 -0500 |
1690 |
*************** |
1761 |
*************** |
1691 |
*** 154,159 **** |
1762 |
*** 154,159 **** |
1692 |
--- 154,163 ---- |
1763 |
--- 154,163 ---- |
Link Here
|
1783 |
} |
1854 |
} |
1784 |
} |
1855 |
} |
1785 |
|
1856 |
|
1786 |
*** mutt-1.5.23-orig/PATCHES 2014-03-12 11:03:44.000000000 -0500 |
1857 |
*** mutt-1.5.24-orig/PATCHES 2015-08-30 12:06:38.000000000 -0500 |
1787 |
--- mutt-1.5.23/PATCHES 2014-04-12 12:36:35.000000000 -0500 |
1858 |
--- mutt-1.5.24/PATCHES 2015-11-11 09:39:02.000000000 -0600 |
1788 |
*************** |
1859 |
*************** |
1789 |
*** 0 **** |
1860 |
*** 0 **** |
1790 |
--- 1 ---- |
1861 |
--- 1 ---- |
1791 |
+ patch-1.5.23.sidebar.20140412.txt |
1862 |
+ patch-1.5.24.sidebar.20151111.txt |
1792 |
*** mutt-1.5.23-orig/protos.h 2014-03-12 11:06:17.000000000 -0500 |
1863 |
*** mutt-1.5.24-orig/protos.h 2015-08-30 12:06:38.000000000 -0500 |
1793 |
--- mutt-1.5.23/protos.h 2014-04-11 10:14:01.000000000 -0500 |
1864 |
--- mutt-1.5.24/protos.h 2015-09-16 23:18:13.000000000 -0500 |
1794 |
*************** |
1865 |
*************** |
1795 |
*** 36,41 **** |
1866 |
*** 36,41 **** |
1796 |
--- 36,48 ---- |
1867 |
--- 36,48 ---- |
Link Here
|
1807 |
void mutt_make_string_info (char *, size_t, const char *, struct hdr_format_info *, format_flag); |
1878 |
void mutt_make_string_info (char *, size_t, const char *, struct hdr_format_info *, format_flag); |
1808 |
|
1879 |
|
1809 |
int mutt_extract_token (BUFFER *, BUFFER *, int); |
1880 |
int mutt_extract_token (BUFFER *, BUFFER *, int); |
1810 |
*** mutt-1.5.23-orig/sidebar.c 1969-12-31 18:00:00.000000000 -0600 |
1881 |
*** mutt-1.5.24-orig/sidebar.c 1969-12-31 18:00:00.000000000 -0600 |
1811 |
--- mutt-1.5.23/sidebar.c 2014-04-11 10:14:01.000000000 -0500 |
1882 |
--- /dev/null 2015-12-15 19:07:50.000000000 +0100 |
1812 |
*************** |
1883 |
+++ tmp/sidebar.c 2015-12-15 19:06:57.000000000 +0100 |
1813 |
*** 0 **** |
1884 |
@@ -0,0 +1,419 @@ |
1814 |
--- 1,405 ---- |
1885 |
+/* |
1815 |
+ /* |
1886 |
+ * Copyright (C) ????-2004 Justin Hibbits <jrh29@po.cwru.edu> |
1816 |
+ * Copyright (C) ????-2004 Justin Hibbits <jrh29@po.cwru.edu> |
1887 |
+ * Copyright (C) 2004 Thomer M. Gil <mutt@thomer.com> |
1817 |
+ * Copyright (C) 2004 Thomer M. Gil <mutt@thomer.com> |
1888 |
+ * |
1818 |
+ * |
1889 |
+ * This program is free software; you can redistribute it and/or modify |
1819 |
+ * This program is free software; you can redistribute it and/or modify |
1890 |
+ * it under the terms of the GNU General Public License as published by |
1820 |
+ * it under the terms of the GNU General Public License as published by |
1891 |
+ * the Free Software Foundation; either version 2 of the License, or |
1821 |
+ * the Free Software Foundation; either version 2 of the License, or |
1892 |
+ * (at your option) any later version. |
1822 |
+ * (at your option) any later version. |
1893 |
+ * |
1823 |
+ * |
1894 |
+ * This program is distributed in the hope that it will be useful, |
1824 |
+ * This program is distributed in the hope that it will be useful, |
1895 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1825 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1896 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1826 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1897 |
+ * GNU General Public License for more details. |
1827 |
+ * GNU General Public License for more details. |
1898 |
+ * |
1828 |
+ * |
1899 |
+ * You should have received a copy of the GNU General Public License |
1829 |
+ * You should have received a copy of the GNU General Public License |
1900 |
+ * along with this program; if not, write to the Free Software |
1830 |
+ * along with this program; if not, write to the Free Software |
1901 |
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. |
1831 |
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. |
1902 |
+ */ |
1832 |
+ */ |
1903 |
+ |
1833 |
+ |
1904 |
+ |
1834 |
+ |
1905 |
+#if HAVE_CONFIG_H |
1835 |
+ #if HAVE_CONFIG_H |
1906 |
+# include "config.h" |
1836 |
+ # include "config.h" |
1907 |
+#endif |
1837 |
+ #endif |
1908 |
+ |
1838 |
+ |
1909 |
+#include "mutt.h" |
1839 |
+ #include "mutt.h" |
1910 |
+#include "mutt_menu.h" |
1840 |
+ #include "mutt_menu.h" |
1911 |
+#include "mutt_curses.h" |
1841 |
+ #include "mutt_curses.h" |
1912 |
+#include "sidebar.h" |
1842 |
+ #include "sidebar.h" |
1913 |
+#include "buffy.h" |
1843 |
+ #include "buffy.h" |
1914 |
+#include <libgen.h> |
1844 |
+ #include <libgen.h> |
1915 |
+#include "keymap.h" |
1845 |
+ #include "keymap.h" |
1916 |
+#include <stdbool.h> |
1846 |
+ #include <stdbool.h> |
1917 |
+ |
1847 |
+ |
1918 |
+/*BUFFY *CurBuffy = 0;*/ |
1848 |
+ /*BUFFY *CurBuffy = 0;*/ |
1919 |
+static BUFFY *TopBuffy = 0; |
1849 |
+ static BUFFY *TopBuffy = 0; |
1920 |
+static BUFFY *BottomBuffy = 0; |
1850 |
+ static BUFFY *BottomBuffy = 0; |
1921 |
+static int known_lines = 0; |
1851 |
+ static int known_lines = 0; |
1922 |
+ |
1852 |
+ |
1923 |
+void calc_boundaries() { |
1853 |
+ void calc_boundaries() { |
1924 |
+ |
1854 |
+ |
1925 |
+ BUFFY *tmp = Incoming; |
1855 |
+ BUFFY *tmp = Incoming; |
1926 |
+ |
1856 |
+ |
1927 |
+ int count = LINES - 2 - (option(OPTHELP) ? 1 : 0); |
1857 |
+ int count = LINES - 2 - (option(OPTHELP) ? 1 : 0); |
1928 |
+ |
1858 |
+ |
1929 |
+ if ( known_lines != LINES ) { |
1859 |
+ if ( known_lines != LINES ) { |
1930 |
+ TopBuffy = BottomBuffy = 0; |
1860 |
+ TopBuffy = BottomBuffy = 0; |
1931 |
+ known_lines = LINES; |
1861 |
+ known_lines = LINES; |
1932 |
+ } |
1862 |
+ } |
1933 |
+ for ( ; tmp->next != 0; tmp = tmp->next ) |
1863 |
+ for ( ; tmp->next != 0; tmp = tmp->next ) |
1934 |
+ tmp->next->prev = tmp; |
1864 |
+ tmp->next->prev = tmp; |
1935 |
+ |
1865 |
+ |
1936 |
+ if ( TopBuffy == 0 && BottomBuffy == 0 ) |
1866 |
+ if ( TopBuffy == 0 && BottomBuffy == 0 ) |
1937 |
+ TopBuffy = Incoming; |
1867 |
+ TopBuffy = Incoming; |
1938 |
+ if ( BottomBuffy == 0 ) { |
1868 |
+ if ( BottomBuffy == 0 ) { |
1939 |
+ BottomBuffy = TopBuffy; |
1869 |
+ BottomBuffy = TopBuffy; |
1940 |
+ while ( --count && BottomBuffy->next ) |
1870 |
+ while ( --count && BottomBuffy->next ) |
1941 |
+ BottomBuffy = BottomBuffy->next; |
1871 |
+ BottomBuffy = BottomBuffy->next; |
1942 |
+ } |
1872 |
+ } |
1943 |
+ else if ( TopBuffy == CurBuffy->next ) { |
1873 |
+ else if ( TopBuffy == CurBuffy->next ) { |
1944 |
+ BottomBuffy = CurBuffy; |
1874 |
+ BottomBuffy = CurBuffy; |
1945 |
+ tmp = BottomBuffy; |
1875 |
+ tmp = BottomBuffy; |
1946 |
+ while ( --count && tmp->prev) |
1876 |
+ while ( --count && tmp->prev) |
1947 |
+ tmp = tmp->prev; |
1877 |
+ tmp = tmp->prev; |
1948 |
+ TopBuffy = tmp; |
1878 |
+ TopBuffy = tmp; |
1949 |
+ } |
1879 |
+ } |
1950 |
+ else if ( BottomBuffy == CurBuffy->prev ) { |
1880 |
+ else if ( BottomBuffy == CurBuffy->prev ) { |
1951 |
+ TopBuffy = CurBuffy; |
1881 |
+ TopBuffy = CurBuffy; |
1952 |
+ tmp = TopBuffy; |
1882 |
+ tmp = TopBuffy; |
1953 |
+ while ( --count && tmp->next ) |
1883 |
+ while ( --count && tmp->next ) |
1954 |
+ tmp = tmp->next; |
1884 |
+ tmp = tmp->next; |
1955 |
+ BottomBuffy = tmp; |
1885 |
+ BottomBuffy = tmp; |
1956 |
+ } |
1886 |
+ } |
1957 |
+} |
1887 |
+ } |
1958 |
+ |
1888 |
+ |
1959 |
+static const char * |
1889 |
+ static const char * |
1960 |
+sidebar_format_str (char *dest, |
1890 |
+ sidebar_format_str (char *dest, |
1961 |
+ size_t destlen, |
1891 |
+ size_t destlen, |
1962 |
+ size_t col, |
1892 |
+ size_t col, |
1963 |
+ char op, |
1893 |
+ char op, |
1964 |
+ const char *src, |
1894 |
+ const char *src, |
1965 |
+ const char *prefix, |
1895 |
+ const char *prefix, |
1966 |
+ const char *ifstring, |
1896 |
+ const char *ifstring, |
1967 |
+ const char *elsestring, |
1897 |
+ const char *elsestring, |
1968 |
+ unsigned long data, |
1898 |
+ unsigned long data, |
1969 |
+ format_flag flags) |
1899 |
+ format_flag flags) |
1970 |
+{ |
1900 |
+ { |
1971 |
+/* casting from unsigned long - srsly?! */ |
1901 |
+ /* casting from unsigned long - srsly?! */ |
1972 |
+struct sidebar_entry *sbe = (struct sidebar_entry *) data; |
1902 |
+ struct sidebar_entry *sbe = (struct sidebar_entry *) data; |
1973 |
+unsigned int optional; |
1903 |
+ unsigned int optional; |
1974 |
+char fmt[SHORT_STRING], buf[SHORT_STRING]; |
1904 |
+ char fmt[SHORT_STRING], buf[SHORT_STRING]; |
1975 |
+ |
1905 |
+ |
1976 |
+optional = flags & M_FORMAT_OPTIONAL; |
1906 |
+ optional = flags & M_FORMAT_OPTIONAL; |
1977 |
+ |
1907 |
+ |
1978 |
+switch(op) { |
1908 |
+ switch(op) { |
1979 |
+ case 'F': |
1909 |
+ case 'F': |
1980 |
+ if(!optional) { |
1910 |
+ if(!optional) { |
1981 |
+ snprintf (fmt, sizeof (fmt), "%%%sd", prefix); |
1911 |
+ snprintf (fmt, sizeof (fmt), "%%%sd", prefix); |
1982 |
+ snprintf (dest, destlen, fmt, sbe->flagged); |
1912 |
+ snprintf (dest, destlen, fmt, sbe->flagged); |
1983 |
+ } else if(sbe->flagged == 0) { |
1913 |
+ } else if(sbe->flagged == 0) { |
1984 |
+ optional = 0; |
1914 |
+ optional = 0; |
1985 |
+ } |
1915 |
+ } |
1986 |
+ break; |
1916 |
+ break; |
1987 |
+ |
1917 |
+ |
1988 |
+ case '!': |
1918 |
+ case '!': |
1989 |
+ if(sbe->flagged == 0) |
1919 |
+ if(sbe->flagged == 0) |
1990 |
+ mutt_format_s(dest, destlen, prefix, ""); |
1920 |
+ mutt_format_s(dest, destlen, prefix, ""); |
1991 |
+ if(sbe->flagged == 1) |
1921 |
+ if(sbe->flagged == 1) |
1992 |
+ mutt_format_s(dest, destlen, prefix, "!"); |
1922 |
+ mutt_format_s(dest, destlen, prefix, "!"); |
1993 |
+ if(sbe->flagged == 2) |
1923 |
+ if(sbe->flagged == 2) |
1994 |
+ mutt_format_s(dest, destlen, prefix, "!!"); |
1924 |
+ mutt_format_s(dest, destlen, prefix, "!!"); |
1995 |
+ if(sbe->flagged > 2) { |
1925 |
+ if(sbe->flagged > 2) { |
1996 |
+ snprintf (buf, sizeof (buf), "%d!", sbe->flagged); |
1926 |
+ snprintf (buf, sizeof (buf), "%d!", sbe->flagged); |
1997 |
+ mutt_format_s(dest, destlen, prefix, buf); |
1927 |
+ mutt_format_s(dest, destlen, prefix, buf); |
1998 |
+ } |
1928 |
+ } |
1999 |
+ break; |
1929 |
+ break; |
2000 |
+ |
1930 |
+ |
2001 |
+ case 'S': |
1931 |
+ case 'S': |
2002 |
+ if(!optional) { |
1932 |
+ snprintf (fmt, sizeof (fmt), "%%%sd", prefix); |
2003 |
+ snprintf (fmt, sizeof (fmt), "%%%sd", prefix); |
1933 |
+ snprintf (dest, destlen, fmt, sbe->size); |
2004 |
+ snprintf (dest, destlen, fmt, sbe->size); |
1934 |
+ break; |
2005 |
+ } else if (sbe->size == 0) { |
1935 |
+ |
2006 |
+ optional = 0; |
1936 |
+ case 'N': |
2007 |
+ } |
1937 |
+ if(!optional) { |
2008 |
+ break; |
1938 |
+ snprintf (fmt, sizeof (fmt), "%%%sd", prefix); |
2009 |
+ |
1939 |
+ snprintf (dest, destlen, fmt, sbe->new); |
2010 |
+ case 'N': |
1940 |
+ } else if(sbe->new == 0) { |
2011 |
+ if(!optional) { |
1941 |
+ optional = 0; |
2012 |
+ snprintf (fmt, sizeof (fmt), "%%%sd", prefix); |
1942 |
+ } |
2013 |
+ snprintf (dest, destlen, fmt, sbe->new); |
1943 |
+ break; |
2014 |
+ } else if(sbe->new == 0) { |
1944 |
+ |
2015 |
+ optional = 0; |
1945 |
+ case 'B': |
2016 |
+ } |
1946 |
+ mutt_format_s(dest, destlen, prefix, sbe->box); |
2017 |
+ break; |
1947 |
+ break; |
2018 |
+ |
1948 |
+ } |
2019 |
+ case 'B': |
1949 |
+ |
2020 |
+ mutt_format_s(dest, destlen, prefix, sbe->box); |
1950 |
+ if(optional) |
2021 |
+ break; |
1951 |
+ mutt_FormatString (dest, destlen, col, ifstring, sidebar_format_str, (unsigned long) sbe, flags); |
2022 |
+ } |
1952 |
+ else if (flags & M_FORMAT_OPTIONAL) |
2023 |
+ |
1953 |
+ mutt_FormatString (dest, destlen, col, elsestring, sidebar_format_str, (unsigned long) sbe, flags); |
2024 |
+ if(optional) |
1954 |
+ |
2025 |
+ mutt_FormatString (dest, destlen, col, ifstring, sidebar_format_str, (unsigned long) sbe, flags); |
1955 |
+ return (src); |
2026 |
+ else if (flags & M_FORMAT_OPTIONAL) |
1956 |
+ } |
2027 |
+ mutt_FormatString (dest, destlen, col, elsestring, sidebar_format_str, (unsigned long) sbe, flags); |
1957 |
+ |
2028 |
+ |
1958 |
+ char *make_sidebar_entry(char *box, unsigned int size, unsigned int new, unsigned int flagged) { |
2029 |
+ return (src); |
1959 |
+ static char *entry = 0; |
2030 |
+} |
1960 |
+ struct sidebar_entry sbe; |
2031 |
+ |
1961 |
+ int SBvisual; |
2032 |
+char *make_sidebar_entry(char *box, unsigned int size, unsigned int new, unsigned int flagged) { |
1962 |
+ |
2033 |
+ static char *entry = 0; |
1963 |
+ SBvisual = SidebarWidth - strlen(SidebarDelim); |
2034 |
+ struct sidebar_entry sbe; |
1964 |
+ if (SBvisual < 1) |
2035 |
+ int SBvisual; |
1965 |
+ return NULL; |
2036 |
+ |
1966 |
+ |
2037 |
+ SBvisual = SidebarWidth - strlen(SidebarDelim); |
1967 |
+ sbe.new = new; |
2038 |
+ if (SBvisual < 1) |
1968 |
+ sbe.flagged = flagged; |
2039 |
+ return NULL; |
1969 |
+ sbe.size = size; |
2040 |
+ |
1970 |
+ strncpy(sbe.box, box, 31); |
2041 |
+ sbe.new = new; |
1971 |
+ |
2042 |
+ sbe.flagged = flagged; |
1972 |
+ safe_realloc(&entry, SBvisual + 2); |
2043 |
+ sbe.size = size; |
1973 |
+ entry[SBvisual + 1] = '\0'; |
2044 |
+ strncpy(sbe.box, box, SHORT_STRING-1); |
1974 |
+ |
2045 |
+ |
1975 |
+ mutt_FormatString (entry, SBvisual+1, 0, SidebarFormat, sidebar_format_str, (unsigned long) &sbe, 0); |
2046 |
+ safe_realloc(&entry, SBvisual + 2); |
1976 |
+ |
2047 |
+ entry[SBvisual + 1] = '\0'; |
1977 |
+ return entry; |
2048 |
+ |
1978 |
+ } |
2049 |
+ mutt_FormatString (entry, SBvisual+1, 0, SidebarFormat, sidebar_format_str, (unsigned long) &sbe, 0); |
1979 |
+ |
2050 |
+ |
1980 |
+ void set_curbuffy(char buf[LONG_STRING]) |
2051 |
+ return entry; |
1981 |
+ { |
2052 |
+} |
1982 |
+ BUFFY* tmp = CurBuffy = Incoming; |
2053 |
+ |
1983 |
+ |
2054 |
+void set_curbuffy(char buf[LONG_STRING]) |
1984 |
+ if (!Incoming) |
2055 |
+{ |
1985 |
+ return; |
2056 |
+ BUFFY* tmp = CurBuffy = Incoming; |
1986 |
+ |
2057 |
+ |
1987 |
+ while(1) { |
2058 |
+ if (!Incoming) |
1988 |
+ if(!strcmp(tmp->path, buf) || !strcmp(tmp->realpath, buf)) { |
2059 |
+ return; |
1989 |
+ CurBuffy = tmp; |
2060 |
+ |
1990 |
+ break; |
2061 |
+ while(1) { |
1991 |
+ } |
2062 |
+ if(!strcmp(tmp->path, buf) || !strcmp(tmp->realpath, buf)) { |
1992 |
+ |
2063 |
+ CurBuffy = tmp; |
1993 |
+ if(tmp->next) |
2064 |
+ break; |
1994 |
+ tmp = tmp->next; |
2065 |
+ } |
1995 |
+ else |
2066 |
+ |
1996 |
+ break; |
2067 |
+ if(tmp->next) |
1997 |
+ } |
2068 |
+ tmp = tmp->next; |
1998 |
+ } |
2069 |
+ else |
1999 |
+ |
2070 |
+ break; |
2000 |
+ int draw_sidebar(int menu) { |
2071 |
+ } |
2001 |
+ |
2072 |
+} |
2002 |
+ BUFFY *tmp; |
2073 |
+ |
2003 |
+ #ifndef USE_SLANG_CURSES |
2074 |
+int draw_sidebar(int menu) { |
2004 |
+ attr_t attrs; |
2075 |
+ |
2005 |
+ #endif |
2076 |
+ BUFFY *tmp; |
2006 |
+ short delim_len = strlen(SidebarDelim); |
2077 |
+#ifndef USE_SLANG_CURSES |
2007 |
+ short color_pair; |
2078 |
+ attr_t attrs; |
2008 |
+ |
2079 |
+#endif |
2009 |
+ static bool initialized = false; |
2080 |
+ short delim_len = strlen(SidebarDelim); |
2010 |
+ static int prev_show_value; |
2081 |
+ short color_pair; |
2011 |
+ static short saveSidebarWidth; |
2082 |
+ |
2012 |
+ int lines = 0; |
2083 |
+ static bool initialized = false; |
2013 |
+ int SidebarHeight; |
2084 |
+ static int prev_show_value; |
2014 |
+ |
2085 |
+ static short saveSidebarWidth; |
2015 |
+ if(option(OPTSTATUSONTOP) || option(OPTHELP)) |
2086 |
+ int lines = 0; |
2016 |
+ lines++; /* either one will occupy the first line */ |
2087 |
+ int SidebarHeight; |
2017 |
+ |
2088 |
+ |
2018 |
+ /* initialize first time */ |
2089 |
+ if(option(OPTSTATUSONTOP) || option(OPTHELP)) |
2019 |
+ if(!initialized) { |
2090 |
+ lines++; /* either one will occupy the first line */ |
2020 |
+ prev_show_value = option(OPTSIDEBAR); |
2091 |
+ |
2021 |
+ saveSidebarWidth = SidebarWidth; |
2092 |
+ /* initialize first time */ |
2022 |
+ if(!option(OPTSIDEBAR)) SidebarWidth = 0; |
2093 |
+ if(!initialized) { |
2023 |
+ initialized = true; |
2094 |
+ prev_show_value = option(OPTSIDEBAR); |
2024 |
+ } |
2095 |
+ saveSidebarWidth = SidebarWidth; |
2025 |
+ |
2096 |
+ if(!option(OPTSIDEBAR)) SidebarWidth = 0; |
2026 |
+ /* save or restore the value SidebarWidth */ |
2097 |
+ initialized = true; |
2027 |
+ if(prev_show_value != option(OPTSIDEBAR)) { |
|
|
2028 |
+ if(prev_show_value && !option(OPTSIDEBAR)) { |
2029 |
+ saveSidebarWidth = SidebarWidth; |
2030 |
+ SidebarWidth = 0; |
2031 |
+ } else if(!prev_show_value && option(OPTSIDEBAR)) { |
2032 |
+ mutt_buffy_check(1); /* we probably have bad or no numbers */ |
2033 |
+ SidebarWidth = saveSidebarWidth; |
2034 |
+ } |
2035 |
+ prev_show_value = option(OPTSIDEBAR); |
2036 |
+ } |
2037 |
+ |
2038 |
+ |
2039 |
+ /* if ( SidebarWidth == 0 ) return 0; */ |
2040 |
+ if (SidebarWidth > 0 && option (OPTSIDEBAR) |
2041 |
+ && delim_len >= SidebarWidth) { |
2042 |
+ unset_option (OPTSIDEBAR); |
2043 |
+ /* saveSidebarWidth = SidebarWidth; */ |
2044 |
+ if (saveSidebarWidth > delim_len) { |
2045 |
+ SidebarWidth = saveSidebarWidth; |
2046 |
+ mutt_error (_("Value for sidebar_delim is too long. Disabling sidebar.")); |
2047 |
+ sleep (2); |
2048 |
+ } else { |
2049 |
+ SidebarWidth = 0; |
2050 |
+ mutt_error (_("Value for sidebar_delim is too long. Disabling sidebar. Please set your sidebar_width to a sane value.")); |
2051 |
+ sleep (4); /* the advise to set a sane value should be seen long enough */ |
2052 |
+ } |
2053 |
+ saveSidebarWidth = 0; |
2054 |
+ return (0); |
2055 |
+ } |
2098 |
+ } |
2056 |
+ |
2099 |
+ |
2057 |
+ if ( SidebarWidth == 0 || !option(OPTSIDEBAR)) { |
2100 |
+ /* save or restore the value SidebarWidth */ |
2058 |
+ if (SidebarWidth > 0) { |
2101 |
+ if(prev_show_value != option(OPTSIDEBAR)) { |
2059 |
+ saveSidebarWidth = SidebarWidth; |
2102 |
+ if(prev_show_value && !option(OPTSIDEBAR)) { |
2060 |
+ SidebarWidth = 0; |
2103 |
+ saveSidebarWidth = SidebarWidth; |
|
|
2104 |
+ SidebarWidth = 0; |
2105 |
+ } else if(!prev_show_value && option(OPTSIDEBAR)) { |
2106 |
+ mutt_buffy_check(1); /* we probably have bad or no numbers */ |
2107 |
+ SidebarWidth = saveSidebarWidth; |
2108 |
+ } |
2109 |
+ prev_show_value = option(OPTSIDEBAR); |
2110 |
+ } |
2111 |
+ |
2112 |
+ |
2113 |
+/* if ( SidebarWidth == 0 ) return 0; */ |
2114 |
+ if (SidebarWidth > 0 && option (OPTSIDEBAR) |
2115 |
+ && delim_len >= SidebarWidth) { |
2116 |
+ unset_option (OPTSIDEBAR); |
2117 |
+ /* saveSidebarWidth = SidebarWidth; */ |
2118 |
+ if (saveSidebarWidth > delim_len) { |
2119 |
+ SidebarWidth = saveSidebarWidth; |
2120 |
+ mutt_error (_("Value for sidebar_delim is too long. Disabling sidebar.")); |
2121 |
+ sleep (2); |
2122 |
+ } else { |
2123 |
+ SidebarWidth = 0; |
2124 |
+ mutt_error (_("Value for sidebar_delim is too long. Disabling sidebar. Please set your sidebar_width to a sane value.")); |
2125 |
+ sleep (4); /* the advise to set a sane value should be seen long enough */ |
2126 |
+ } |
2127 |
+ saveSidebarWidth = 0; |
2128 |
+ return (0); |
2061 |
+ } |
2129 |
+ } |
2062 |
+ unset_option(OPTSIDEBAR); |
2130 |
+ |
2063 |
+ return 0; |
2131 |
+ if ( SidebarWidth == 0 || !option(OPTSIDEBAR)) { |
2064 |
+ } |
2132 |
+ if (SidebarWidth > 0) { |
2065 |
+ |
2133 |
+ saveSidebarWidth = SidebarWidth; |
2066 |
+ /* get attributes for divider */ |
2134 |
+ SidebarWidth = 0; |
2067 |
+ SETCOLOR(MT_COLOR_STATUS); |
2135 |
+ } |
2068 |
+ #ifndef USE_SLANG_CURSES |
2136 |
+ unset_option(OPTSIDEBAR); |
2069 |
+ attr_get(&attrs, &color_pair, 0); |
2137 |
+ return 0; |
2070 |
+ #else |
2138 |
+ } |
2071 |
+ color_pair = attr_get(); |
2139 |
+ |
2072 |
+ #endif |
2140 |
+ /* get attributes for divider */ |
2073 |
+ SETCOLOR(MT_COLOR_NORMAL); |
2141 |
+ SETCOLOR(MT_COLOR_STATUS); |
2074 |
+ |
2142 |
+#ifndef USE_SLANG_CURSES |
2075 |
+ /* draw the divider */ |
2143 |
+ attr_get(&attrs, &color_pair, 0); |
2076 |
+ |
2144 |
+#else |
2077 |
+ SidebarHeight = LINES - 1; |
2145 |
+ color_pair = attr_get(); |
2078 |
+ if(option(OPTHELP) || !option(OPTSTATUSONTOP)) |
2146 |
+#endif |
2079 |
+ SidebarHeight--; |
2147 |
+ SETCOLOR(MT_COLOR_NORMAL); |
2080 |
+ |
2148 |
+ |
2081 |
+ for ( ; lines < SidebarHeight; lines++ ) { |
2149 |
+ /* draw the divider */ |
2082 |
+ move(lines, SidebarWidth - delim_len); |
2150 |
+ |
2083 |
+ addstr(NONULL(SidebarDelim)); |
2151 |
+ SidebarHeight = LINES - 1; |
2084 |
+ #ifndef USE_SLANG_CURSES |
2152 |
+ if(option(OPTHELP) || !option(OPTSTATUSONTOP)) |
2085 |
+ mvchgat(lines, SidebarWidth - delim_len, delim_len, 0, color_pair, NULL); |
2153 |
+ SidebarHeight--; |
2086 |
+ #endif |
2154 |
+ |
2087 |
+ } |
2155 |
+ for ( ; lines < SidebarHeight; lines++ ) { |
2088 |
+ |
2156 |
+ move(lines, SidebarWidth - delim_len); |
2089 |
+ if ( Incoming == 0 ) return 0; |
2157 |
+ addstr(NONULL(SidebarDelim)); |
2090 |
+ lines = 0; |
2158 |
+#ifndef USE_SLANG_CURSES |
2091 |
+ if(option(OPTSTATUSONTOP) || option(OPTHELP)) |
2159 |
+ mvchgat(lines, SidebarWidth - delim_len, delim_len, 0, color_pair, NULL); |
2092 |
+ lines++; /* either one will occupy the first line */ |
2160 |
+#endif |
2093 |
+ |
2161 |
+ } |
2094 |
+ if ( known_lines != LINES || TopBuffy == 0 || BottomBuffy == 0 ) |
2162 |
+ |
2095 |
+ calc_boundaries(menu); |
2163 |
+ if ( Incoming == 0 ) return 0; |
2096 |
+ if ( CurBuffy == 0 ) CurBuffy = Incoming; |
2164 |
+ lines = 0; |
2097 |
+ |
2165 |
+ if(option(OPTSTATUSONTOP) || option(OPTHELP)) |
2098 |
+ tmp = TopBuffy; |
2166 |
+ lines++; /* either one will occupy the first line */ |
2099 |
+ |
2167 |
+ |
2100 |
+ SETCOLOR(MT_COLOR_NORMAL); |
2168 |
+ if ( known_lines != LINES || TopBuffy == 0 || BottomBuffy == 0 ) |
2101 |
+ |
2169 |
+ calc_boundaries(menu); |
2102 |
+ for ( ; tmp && lines < SidebarHeight; tmp = tmp->next ) { |
2170 |
+ if ( CurBuffy == 0 ) CurBuffy = Incoming; |
2103 |
+ if ( tmp == CurBuffy ) |
2171 |
+ |
2104 |
+ SETCOLOR(MT_COLOR_INDICATOR); |
2172 |
+ tmp = TopBuffy; |
2105 |
+ else if ( tmp->msg_unread > 0 ) |
2173 |
+ |
2106 |
+ SETCOLOR(MT_COLOR_NEW); |
2174 |
+ SETCOLOR(MT_COLOR_NORMAL); |
2107 |
+ else if ( tmp->msg_flagged > 0 ) |
2175 |
+ |
2108 |
+ SETCOLOR(MT_COLOR_FLAGGED); |
2176 |
+ for ( ; tmp && lines < SidebarHeight; tmp = tmp->next ) { |
2109 |
+ else |
2177 |
+ if ( tmp == CurBuffy ) |
2110 |
+ SETCOLOR(MT_COLOR_NORMAL); |
2178 |
+ SETCOLOR(MT_COLOR_INDICATOR); |
2111 |
+ |
2179 |
+ else if ( tmp->msg_unread > 0 ) |
2112 |
+ move( lines, 0 ); |
2180 |
+ SETCOLOR(MT_COLOR_NEW); |
2113 |
+ if ( Context && (!strcmp(tmp->path, Context->path)|| |
2181 |
+ else if ( tmp->msg_flagged > 0 ) |
2114 |
+ !strcmp(tmp->realpath, Context->path)) ) { |
2182 |
+ SETCOLOR(MT_COLOR_FLAGGED); |
2115 |
+ tmp->msg_unread = Context->unread; |
2183 |
+ else |
2116 |
+ tmp->msgcount = Context->msgcount; |
2184 |
+ SETCOLOR(MT_COLOR_NORMAL); |
2117 |
+ tmp->msg_flagged = Context->flagged; |
2185 |
+ |
2118 |
+ } |
2186 |
+ move( lines, 0 ); |
2119 |
+ /* check whether Maildir is a prefix of the current folder's path */ |
2187 |
+ if ( Context && Context->path && |
2120 |
+ short maildir_is_prefix = 0; |
2188 |
+ (!strcmp(tmp->path, Context->path)|| |
2121 |
+ if ( (strlen(tmp->path) > strlen(Maildir)) && |
2189 |
+ !strcmp(tmp->realpath, Context->path)) ) { |
2122 |
+ (strncmp(Maildir, tmp->path, strlen(Maildir)) == 0) ) |
2190 |
+ tmp->msg_unread = Context->unread; |
2123 |
+ maildir_is_prefix = 1; |
2191 |
+ tmp->msgcount = Context->msgcount; |
2124 |
+ /* calculate depth of current folder and generate its display name with indented spaces */ |
2192 |
+ tmp->msg_flagged = Context->flagged; |
2125 |
+ int sidebar_folder_depth = 0; |
2193 |
+ } |
2126 |
+ char *sidebar_folder_name; |
2194 |
+ /* check whether Maildir is a prefix of the current folder's path */ |
2127 |
+ sidebar_folder_name = option(OPTSIDEBARSHORTPATH) ? mutt_basename(tmp->path) : tmp->path + maildir_is_prefix*(strlen(Maildir) + 1); |
2195 |
+ short maildir_is_prefix = 0; |
2128 |
+ if ( maildir_is_prefix && option(OPTSIDEBARFOLDERINDENT) ) { |
2196 |
+ if ( (strlen(tmp->path) > strlen(Maildir)) && |
2129 |
+ char *tmp_folder_name; |
2197 |
+ (strncmp(Maildir, tmp->path, strlen(Maildir)) == 0) ) |
2130 |
+ int i; |
2198 |
+ maildir_is_prefix = 1; |
2131 |
+ tmp_folder_name = tmp->path + strlen(Maildir) + 1; |
2199 |
+ /* calculate depth of current folder and generate its display name with indented spaces */ |
2132 |
+ for (i = 0; i < strlen(tmp->path) - strlen(Maildir); i++) { |
2200 |
+ int sidebar_folder_depth = 0; |
2133 |
+ if (tmp_folder_name[i] == '/' || tmp_folder_name[i] == '.') sidebar_folder_depth++; |
2201 |
+ char *sidebar_folder_name; |
2134 |
+ } |
2202 |
+ sidebar_folder_name = option(OPTSIDEBARSHORTPATH) ? mutt_basename(tmp->path) : tmp->path + maildir_is_prefix*(strlen(Maildir) + ((Maildir[strlen(Maildir) - 1] == '/' || Maildir[strlen(Maildir) - 1] == '}') ? 0 : 1)); |
2135 |
+ if (sidebar_folder_depth > 0) { |
2203 |
+ /* sidebar_folder_name = option(OPTSIDEBARSHORTPATH) ? mutt_basename(tmp->path) : tmp->path + maildir_is_prefix*(strlen(Maildir) + 1); */ |
2136 |
+ if (option(OPTSIDEBARSHORTPATH)) { |
2204 |
+ if ( maildir_is_prefix && option(OPTSIDEBARFOLDERINDENT) ) { |
2137 |
+ tmp_folder_name = strrchr(tmp->path, '.'); |
2205 |
+ char *tmp_folder_name; |
2138 |
+ if (tmp_folder_name == NULL) |
2206 |
+ char *tmp_folder_name_dot; |
|
|
2207 |
+ char *tmp_folder_name_slash; |
2208 |
+ int i; |
2209 |
+ tmp_folder_name = tmp->path + strlen(Maildir) + 1; |
2210 |
+ for (i = 0; i < strlen(tmp->path) - strlen(Maildir); i++) { |
2211 |
+ if (tmp_folder_name[i] == '/' || tmp_folder_name[i] == '.') sidebar_folder_depth++; |
2212 |
+ } |
2213 |
+ if (sidebar_folder_depth > 0) { |
2214 |
+ if (option(OPTSIDEBARSHORTPATH)) { |
2215 |
+ tmp_folder_name_dot = strrchr(tmp->path, '.'); |
2216 |
+ tmp_folder_name_slash = strrchr(tmp->path, '/'); |
2217 |
+ if (tmp_folder_name_dot == NULL && tmp_folder_name_slash == NULL) |
2139 |
+ tmp_folder_name = mutt_basename(tmp->path); |
2218 |
+ tmp_folder_name = mutt_basename(tmp->path); |
2140 |
+ else |
2219 |
+ tmp_folder_name = strrchr(tmp->path, '.'); |
2141 |
+ tmp_folder_name++; |
2220 |
+ if (tmp_folder_name == NULL) |
2142 |
+ } |
2221 |
+ tmp_folder_name = mutt_basename(tmp->path); |
2143 |
+ else |
2222 |
+ else if (tmp_folder_name_dot > tmp_folder_name_slash) |
2144 |
+ tmp_folder_name = tmp->path + strlen(Maildir) + 1; |
2223 |
+ tmp_folder_name = tmp_folder_name_dot + 1; |
2145 |
+ sidebar_folder_name = malloc(strlen(tmp_folder_name) + sidebar_folder_depth*strlen(NONULL(SidebarIndentStr)) + 1); |
2224 |
+ else |
2146 |
+ sidebar_folder_name[0]=0; |
2225 |
+ tmp_folder_name = tmp_folder_name_slash + 1; |
2147 |
+ for (i=0; i < sidebar_folder_depth; i++) |
2226 |
+ } |
2148 |
+ strncat(sidebar_folder_name, NONULL(SidebarIndentStr), strlen(NONULL(SidebarIndentStr))); |
2227 |
+ else |
2149 |
+ strncat(sidebar_folder_name, tmp_folder_name, strlen(tmp_folder_name)); |
2228 |
+ tmp_folder_name = tmp->path + strlen(Maildir) + ((Maildir[strlen(Maildir) - 1] == '/' || Maildir[strlen(Maildir) - 1] == '}') ? 0 : 1); |
2150 |
+ } |
2229 |
+ sidebar_folder_name = malloc(strlen(tmp_folder_name) + sidebar_folder_depth*strlen(NONULL(SidebarIndentStr)) + 1); |
2151 |
+ } |
2230 |
+ sidebar_folder_name[0]=0; |
2152 |
+ printw( "%.*s", SidebarWidth - delim_len + 1, |
2231 |
+ for (i=0; i < sidebar_folder_depth; i++) |
2153 |
+ make_sidebar_entry(sidebar_folder_name, tmp->msgcount, |
2232 |
+ strncat(sidebar_folder_name, NONULL(SidebarIndentStr), strlen(NONULL(SidebarIndentStr))); |
2154 |
+ tmp->msg_unread, tmp->msg_flagged)); |
2233 |
+ strncat(sidebar_folder_name, tmp_folder_name, strlen(tmp_folder_name)); |
2155 |
+ if (sidebar_folder_depth > 0) |
2234 |
+ } |
2156 |
+ free(sidebar_folder_name); |
2235 |
+ } |
2157 |
+ lines++; |
2236 |
+ printw( "%.*s", SidebarWidth - delim_len + 1, |
2158 |
+ } |
2237 |
+ make_sidebar_entry(sidebar_folder_name, tmp->msgcount, |
2159 |
+ SETCOLOR(MT_COLOR_NORMAL); |
2238 |
+ tmp->msg_unread, tmp->msg_flagged)); |
2160 |
+ for ( ; lines < SidebarHeight; lines++ ) { |
2239 |
+ if (sidebar_folder_depth > 0) |
2161 |
+ int i = 0; |
2240 |
+ free(sidebar_folder_name); |
2162 |
+ move( lines, 0 ); |
2241 |
+ lines++; |
2163 |
+ for ( ; i < SidebarWidth - delim_len; i++ ) |
2242 |
+ } |
2164 |
+ addch(' '); |
2243 |
+ SETCOLOR(MT_COLOR_NORMAL); |
2165 |
+ } |
2244 |
+ for ( ; lines < SidebarHeight; lines++ ) { |
2166 |
+ return 0; |
2245 |
+ int i = 0; |
2167 |
+ } |
2246 |
+ move( lines, 0 ); |
2168 |
+ |
2247 |
+ for ( ; i < SidebarWidth - delim_len; i++ ) |
2169 |
+ |
2248 |
+ addch(' '); |
2170 |
+ void set_buffystats(CONTEXT* Context) |
2249 |
+ } |
2171 |
+ { |
2250 |
+ return 0; |
2172 |
+ BUFFY *tmp = Incoming; |
2251 |
+} |
2173 |
+ while(tmp) { |
2252 |
+ |
2174 |
+ if(Context && (!strcmp(tmp->path, Context->path) || |
2253 |
+ |
2175 |
+ !strcmp(tmp->realpath, Context->path))) { |
2254 |
+void set_buffystats(CONTEXT* Context) |
2176 |
+ tmp->msg_unread = Context->unread; |
2255 |
+{ |
2177 |
+ tmp->msgcount = Context->msgcount; |
2256 |
+ BUFFY *tmp = Incoming; |
2178 |
+ tmp->msg_flagged = Context->flagged; |
2257 |
+ while(tmp) { |
2179 |
+ break; |
2258 |
+ if(Context && (!strcmp(tmp->path, Context->path) || |
2180 |
+ } |
2259 |
+ !strcmp(tmp->realpath, Context->path))) { |
2181 |
+ tmp = tmp->next; |
2260 |
+ tmp->msg_unread = Context->unread; |
2182 |
+ } |
2261 |
+ tmp->msgcount = Context->msgcount; |
2183 |
+ } |
2262 |
+ tmp->msg_flagged = Context->flagged; |
2184 |
+ |
2263 |
+ break; |
2185 |
+ void scroll_sidebar(int op, int menu) |
2264 |
+ } |
2186 |
+ { |
2265 |
+ tmp = tmp->next; |
2187 |
+ if(!SidebarWidth) return; |
2266 |
+ } |
2188 |
+ if(!CurBuffy) return; |
2267 |
+} |
2189 |
+ |
2268 |
+ |
2190 |
+ switch (op) { |
2269 |
+void scroll_sidebar(int op, int menu) |
2191 |
+ case OP_SIDEBAR_NEXT: |
2270 |
+{ |
2192 |
+ if ( CurBuffy->next == NULL ) return; |
2271 |
+ if(!SidebarWidth) return; |
2193 |
+ CurBuffy = CurBuffy->next; |
2272 |
+ if(!CurBuffy) return; |
2194 |
+ break; |
2273 |
+ |
2195 |
+ case OP_SIDEBAR_PREV: |
2274 |
+ switch (op) { |
2196 |
+ if ( CurBuffy->prev == NULL ) return; |
2275 |
+ case OP_SIDEBAR_NEXT: |
2197 |
+ CurBuffy = CurBuffy->prev; |
2276 |
+ if ( CurBuffy->next == NULL ) return; |
2198 |
+ break; |
2277 |
+ CurBuffy = CurBuffy->next; |
2199 |
+ case OP_SIDEBAR_SCROLL_UP: |
2278 |
+ break; |
2200 |
+ CurBuffy = TopBuffy; |
2279 |
+ case OP_SIDEBAR_PREV: |
2201 |
+ if ( CurBuffy != Incoming ) { |
2280 |
+ if ( CurBuffy->prev == NULL ) return; |
2202 |
+ calc_boundaries(menu); |
2281 |
+ CurBuffy = CurBuffy->prev; |
2203 |
+ CurBuffy = CurBuffy->prev; |
2282 |
+ break; |
2204 |
+ } |
2283 |
+ case OP_SIDEBAR_SCROLL_UP: |
2205 |
+ break; |
2284 |
+ CurBuffy = TopBuffy; |
2206 |
+ case OP_SIDEBAR_SCROLL_DOWN: |
2285 |
+ if ( CurBuffy != Incoming ) { |
2207 |
+ CurBuffy = BottomBuffy; |
2286 |
+ calc_boundaries(menu); |
2208 |
+ if ( CurBuffy->next ) { |
2287 |
+ CurBuffy = CurBuffy->prev; |
2209 |
+ calc_boundaries(menu); |
2288 |
+ } |
2210 |
+ CurBuffy = CurBuffy->next; |
2289 |
+ break; |
2211 |
+ } |
2290 |
+ case OP_SIDEBAR_SCROLL_DOWN: |
2212 |
+ break; |
2291 |
+ CurBuffy = BottomBuffy; |
2213 |
+ default: |
2292 |
+ if ( CurBuffy->next ) { |
2214 |
+ return; |
2293 |
+ calc_boundaries(menu); |
2215 |
+ } |
2294 |
+ CurBuffy = CurBuffy->next; |
2216 |
+ calc_boundaries(menu); |
2295 |
+ } |
2217 |
+ draw_sidebar(menu); |
2296 |
+ break; |
2218 |
+ } |
2297 |
+ default: |
2219 |
+ |
2298 |
+ return; |
2220 |
*** mutt-1.5.23-orig/sidebar.h 1969-12-31 18:00:00.000000000 -0600 |
2299 |
+ } |
2221 |
--- mutt-1.5.23/sidebar.h 2014-04-11 10:14:01.000000000 -0500 |
2300 |
+ calc_boundaries(menu); |
|
|
2301 |
+ draw_sidebar(menu); |
2302 |
+} |
2303 |
+ |
2304 |
*** mutt-1.5.24-orig/sidebar.h 1969-12-31 18:00:00.000000000 -0600 |
2305 |
--- mutt-1.5.24/sidebar.h 2015-09-16 23:18:13.000000000 -0500 |
2222 |
*************** |
2306 |
*************** |
2223 |
*** 0 **** |
2307 |
*** 0 **** |
2224 |
--- 1,36 ---- |
2308 |
--- 1,36 ---- |
Link Here
|
2258 |
+ void set_buffystats(CONTEXT*); |
2342 |
+ void set_buffystats(CONTEXT*); |
2259 |
+ |
2343 |
+ |
2260 |
+ #endif /* SIDEBAR_H */ |
2344 |
+ #endif /* SIDEBAR_H */ |
2261 |
*** mutt-1.5.23-orig/doc/Muttrc 2014-03-12 11:27:11.000000000 -0500 |
2345 |
*** mutt-1.5.24-orig/doc/Muttrc 2015-08-30 12:24:53.000000000 -0500 |
2262 |
--- mutt-1.5.23/doc/Muttrc 2014-04-11 10:14:01.000000000 -0500 |
2346 |
--- mutt-1.5.24/doc/Muttrc 2015-09-16 23:18:13.000000000 -0500 |
2263 |
*************** |
2347 |
*************** |
2264 |
*** 657,662 **** |
2348 |
*** 657,662 **** |
2265 |
--- 657,682 ---- |
2349 |
--- 657,682 ---- |
Link Here
|
2289 |
# set crypt_autosign=no |
2373 |
# set crypt_autosign=no |
2290 |
# |
2374 |
# |
2291 |
# Name: crypt_autosign |
2375 |
# Name: crypt_autosign |
2292 |
*** mutt-1.5.23-orig/imap/imap.c 2014-03-12 11:03:45.000000000 -0500 |
2376 |
*** mutt-1.5.24-orig/imap/imap.c 2015-08-30 12:06:38.000000000 -0500 |
2293 |
--- mutt-1.5.23/imap/imap.c 2014-04-11 10:14:01.000000000 -0500 |
2377 |
--- mutt-1.5.24/imap/imap.c 2015-09-16 23:18:13.000000000 -0500 |
2294 |
*************** |
2378 |
*************** |
2295 |
*** 1514,1520 **** |
2379 |
*** 1523,1529 **** |
2296 |
|
2380 |
|
2297 |
imap_munge_mbox_name (munged, sizeof (munged), name); |
2381 |
imap_munge_mbox_name (munged, sizeof (munged), name); |
2298 |
snprintf (command, sizeof (command), |
2382 |
snprintf (command, sizeof (command), |
Link Here
|
2300 |
|
2384 |
|
2301 |
if (imap_exec (idata, command, IMAP_CMD_QUEUE) < 0) |
2385 |
if (imap_exec (idata, command, IMAP_CMD_QUEUE) < 0) |
2302 |
{ |
2386 |
{ |
2303 |
--- 1514,1520 ---- |
2387 |
--- 1523,1529 ---- |
2304 |
|
2388 |
|
2305 |
imap_munge_mbox_name (munged, sizeof (munged), name); |
2389 |
imap_munge_mbox_name (munged, sizeof (munged), name); |
2306 |
snprintf (command, sizeof (command), |
2390 |
snprintf (command, sizeof (command), |
Link Here
|
2308 |
|
2392 |
|
2309 |
if (imap_exec (idata, command, IMAP_CMD_QUEUE) < 0) |
2393 |
if (imap_exec (idata, command, IMAP_CMD_QUEUE) < 0) |
2310 |
{ |
2394 |
{ |
2311 |
*** mutt-1.5.23-orig/imap/command.c 2014-03-12 11:03:45.000000000 -0500 |
2395 |
*** mutt-1.5.24-orig/imap/command.c 2015-08-30 12:06:38.000000000 -0500 |
2312 |
--- mutt-1.5.23/imap/command.c 2014-04-11 10:14:01.000000000 -0500 |
2396 |
--- mutt-1.5.24/imap/command.c 2015-09-16 23:18:13.000000000 -0500 |
2313 |
*************** |
2397 |
*************** |
2314 |
*** 1012,1017 **** |
2398 |
*** 1012,1017 **** |
2315 |
--- 1012,1024 ---- |
2399 |
--- 1012,1024 ---- |