1 |
commit: 4108b3018d0df635c6c5b0e8f7ee3c990a697a6a |
2 |
Author: Daniel Pielmeier <billie <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Mar 9 20:50:00 2017 +0000 |
4 |
Commit: Daniel Pielmeier <billie <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Mar 9 20:50:00 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4108b301 |
7 |
|
8 |
app-admin/conky: Remove unused patches. |
9 |
|
10 |
Package-Manager: Portage-2.3.3, Repoman-2.3.1 |
11 |
|
12 |
.../conky/files/conky-1.8.1-utf8-scroll.patch | 104 -------------------- |
13 |
app-admin/conky/files/conky-1.9.0-apcupsd.patch | 106 --------------------- |
14 |
.../files/conky-1.9.0-default-graph-size.patch | 18 ---- |
15 |
.../conky/files/conky-1.9.0-diskio-dmmajor.patch | 23 ----- |
16 |
app-admin/conky/files/conky-1.9.0-lines-fix.patch | 36 ------- |
17 |
app-admin/conky/files/conky-1.9.0-ncurses.patch | 31 ------ |
18 |
app-admin/conky/files/conky-1.9.0-tinfo.patch | 22 ----- |
19 |
.../files/conky-1.9.0-update-noaa-metar-uri.patch | 11 --- |
20 |
...1.9.0-update-when-message-count-decreases.patch | 75 --------------- |
21 |
9 files changed, 426 deletions(-) |
22 |
|
23 |
diff --git a/app-admin/conky/files/conky-1.8.1-utf8-scroll.patch b/app-admin/conky/files/conky-1.8.1-utf8-scroll.patch |
24 |
deleted file mode 100644 |
25 |
index 8b9e1e8fb9d..00000000000 |
26 |
--- a/app-admin/conky/files/conky-1.8.1-utf8-scroll.patch |
27 |
+++ /dev/null |
28 |
@@ -1,104 +0,0 @@ |
29 |
-From b1f6a30bcce020b3c377434137de9856a09b899a Mon Sep 17 00:00:00 2001 |
30 |
-From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@×××××××.name> |
31 |
-Date: Fri, 11 Nov 2011 11:27:43 +0100 |
32 |
-Subject: [PATCH] Make scroll UTF-8 aware. Fixes bug #3134941. |
33 |
- |
34 |
---- |
35 |
- src/scroll.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- |
36 |
- 1 files changed, 42 insertions(+), 2 deletions(-) |
37 |
- |
38 |
-diff --git a/src/scroll.c b/src/scroll.c |
39 |
-index f78f807..738db0d 100644 |
40 |
---- a/src/scroll.c |
41 |
-+++ b/src/scroll.c |
42 |
-@@ -34,12 +34,33 @@ |
43 |
- |
44 |
- struct scroll_data { |
45 |
- char *text; |
46 |
-+ unsigned int show_orig; |
47 |
- unsigned int show; |
48 |
- unsigned int step; |
49 |
- unsigned int start; |
50 |
- long resetcolor; |
51 |
- }; |
52 |
- |
53 |
-+int utf8_charlen(char c) { |
54 |
-+ unsigned char uc = (unsigned char) c; |
55 |
-+ int len = 0; |
56 |
-+ |
57 |
-+ if ((uc & 0x80) == 0) |
58 |
-+ return 1; |
59 |
-+ |
60 |
-+ while ((uc & 0x80) != 0) { |
61 |
-+ ++len; |
62 |
-+ uc <<= 1; |
63 |
-+ } |
64 |
-+ |
65 |
-+ return (len > 0 && len <= 4) ? len : -1; |
66 |
-+} |
67 |
-+ |
68 |
-+int is_utf8_char_tail(char c) { |
69 |
-+ unsigned char uc = (unsigned char) c; |
70 |
-+ return (uc & 0xc0) == 0x80; |
71 |
-+} |
72 |
-+ |
73 |
- void parse_scroll_arg(struct text_object *obj, const char *arg, void *free_at_crash) |
74 |
- { |
75 |
- struct scroll_data *sd; |
76 |
-@@ -60,15 +81,18 @@ void parse_scroll_arg(struct text_object *obj, const char *arg, void *free_at_cr |
77 |
- sd->step = 1; |
78 |
- } |
79 |
- sd->text = malloc(strlen(arg + n1) + sd->show + 1); |
80 |
-+ // sd->show value may change when there are UTF-8 chars to be shown, so |
81 |
-+ // save its origin value |
82 |
-+ sd->show_orig = sd->show; |
83 |
- |
84 |
- if (strlen(arg) > sd->show) { |
85 |
- for(n2 = 0; (unsigned int) n2 < sd->show; n2++) { |
86 |
-- sd->text[n2] = ' '; |
87 |
-+ sd->text[n2] = ' '; |
88 |
- } |
89 |
- sd->text[n2] = 0; |
90 |
- } |
91 |
- else |
92 |
-- sd->text[0] = 0; |
93 |
-+ sd->text[0] = 0; |
94 |
- |
95 |
- strcat(sd->text, arg + n1); |
96 |
- sd->start = 0; |
97 |
-@@ -82,9 +106,13 @@ void print_scroll(struct text_object *obj, char *p, int p_max_size, struct infor |
98 |
- { |
99 |
- struct scroll_data *sd = obj->data.opaque; |
100 |
- unsigned int j, colorchanges = 0, frontcolorchanges = 0, visibcolorchanges = 0, strend; |
101 |
-+ int charlen = 0; |
102 |
-+ unsigned int utf8lenfix = 0; |
103 |
- char *pwithcolors; |
104 |
- char buf[max_user_text]; |
105 |
- |
106 |
-+ sd->show = sd->show_orig; |
107 |
-+ |
108 |
- if (!sd) |
109 |
- return; |
110 |
- |
111 |
-@@ -109,6 +137,18 @@ void print_scroll(struct text_object *obj, char *p, int p_max_size, struct infor |
112 |
- while(*(buf + sd->start) == SPECIAL_CHAR) { |
113 |
- sd->start++; |
114 |
- } |
115 |
-+ //skip parts of UTF-8 character which messes up display |
116 |
-+ while(is_utf8_char_tail(*(buf + sd->start))) { |
117 |
-+ sd->start++; |
118 |
-+ } |
119 |
-+ //extend length to be shown for wide characters |
120 |
-+ j = 0; |
121 |
-+ while(j < sd->show + visibcolorchanges + utf8lenfix) { |
122 |
-+ charlen = utf8_charlen(*(buf + sd->start + j)); |
123 |
-+ utf8lenfix += (charlen > 1 ? charlen - 1 : 0); |
124 |
-+ j += charlen; |
125 |
-+ } |
126 |
-+ sd->show = sd->show_orig + utf8lenfix; |
127 |
- //place all chars that should be visible in p, including colorchanges |
128 |
- for(j=0; j < sd->show + visibcolorchanges; j++) { |
129 |
- p[j] = *(buf + sd->start + j); |
130 |
--- |
131 |
-1.7.8.rc1 |
132 |
- |
133 |
|
134 |
diff --git a/app-admin/conky/files/conky-1.9.0-apcupsd.patch b/app-admin/conky/files/conky-1.9.0-apcupsd.patch |
135 |
deleted file mode 100644 |
136 |
index 6b942d32c4c..00000000000 |
137 |
--- a/app-admin/conky/files/conky-1.9.0-apcupsd.patch |
138 |
+++ /dev/null |
139 |
@@ -1,106 +0,0 @@ |
140 |
-Description: Fix broken apcupsd support in Conky 1.8.1 |
141 |
- Revert apcupsd-related code to Conky 1.8.0 in order to fix broken apcupsd |
142 |
- support. This is a workaround until upstream properly addresses this issue. |
143 |
-From: Brian Derr <bderrly@×××××.com> |
144 |
-Forwarded: https://sourceforge.net/support/tracker.php?aid=3083859 |
145 |
-Bug-Ubuntu: https://bugs.launchpad.net/bugs/897495 |
146 |
-Last-Update: 2011-12-02 |
147 |
- |
148 |
---- a/src/apcupsd.c |
149 |
-+++ b/src/apcupsd.c |
150 |
-@@ -154,7 +154,7 @@ |
151 |
- // |
152 |
- // Conky update function for apcupsd data |
153 |
- // |
154 |
--int update_apcupsd(void) { |
155 |
-+void update_apcupsd(void) { |
156 |
- |
157 |
- int i; |
158 |
- APCUPSD_S apc; |
159 |
-@@ -164,41 +164,44 @@ |
160 |
- memcpy(apc.items[i], "N/A", 4); // including \0 |
161 |
- |
162 |
- do { |
163 |
-- struct addrinfo hints; |
164 |
-- struct addrinfo *ai, *rp; |
165 |
-- int res; |
166 |
-+ struct hostent* he = 0; |
167 |
-+ struct sockaddr_in addr; |
168 |
- short sz = 0; |
169 |
-- char portbuf[8]; |
170 |
-+#ifdef HAVE_GETHOSTBYNAME_R |
171 |
-+ struct hostent he_mem; |
172 |
-+ int he_errno; |
173 |
-+ char hostbuff[2048]; |
174 |
-+#endif |
175 |
- // |
176 |
- // connect to apcupsd daemon |
177 |
- // |
178 |
-- memset(&hints, 0, sizeof(struct addrinfo)); |
179 |
-- hints.ai_family = AF_UNSPEC; |
180 |
-- hints.ai_socktype = SOCK_STREAM; |
181 |
-- hints.ai_flags = 0; |
182 |
-- hints.ai_protocol = 0; |
183 |
-- snprintf(portbuf, 8, "%d", info.apcupsd.port); |
184 |
-- res = getaddrinfo(info.apcupsd.host, portbuf, &hints, &ai); |
185 |
-- if (res != 0) { |
186 |
-- NORM_ERR("APCUPSD getaddrinfo: %s", gai_strerror(res)); |
187 |
-+ sock = socket(AF_INET, SOCK_STREAM, 0); |
188 |
-+ if (sock < 0) { |
189 |
-+ perror("socket"); |
190 |
- break; |
191 |
- } |
192 |
-- for (rp = ai; rp != NULL; rp = rp->ai_next) { |
193 |
-- sock = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); |
194 |
-- if (sock == -1) { |
195 |
-- continue; |
196 |
-- } |
197 |
-- if (connect(sock, rp->ai_addr, rp->ai_addrlen) != -1) { |
198 |
-- break; |
199 |
-- } |
200 |
-- close(sock); |
201 |
-+#ifdef HAVE_GETHOSTBYNAME_R |
202 |
-+ if (gethostbyname_r(info.apcupsd.host, &he_mem, hostbuff, sizeof(hostbuff), &he, &he_errno) || !he ) { |
203 |
-+ NORM_ERR("APCUPSD gethostbyname_r: %s", hstrerror(h_errno)); |
204 |
-+ break; |
205 |
-+ } |
206 |
-+#else /* HAVE_GETHOSTBYNAME_R */ |
207 |
-+ he = gethostbyname(info.apcupsd.host); |
208 |
-+ if (!he) { |
209 |
-+ herror("gethostbyname"); |
210 |
-+ break; |
211 |
- } |
212 |
-- freeaddrinfo(ai); |
213 |
-- if (rp == NULL) { |
214 |
-+#endif /* HAVE_GETHOSTBYNAME_R */ |
215 |
-+ |
216 |
-+ memset(&addr, 0, sizeof(addr)); |
217 |
-+ addr.sin_family = AF_INET; |
218 |
-+ addr.sin_port = info.apcupsd.port; |
219 |
-+ memcpy(&addr.sin_addr, he->h_addr, he->h_length); |
220 |
-+ if (connect(sock, (struct sockaddr*)&addr, sizeof(struct sockaddr)) < 0) { |
221 |
- // no error reporting, the daemon is probably not running |
222 |
- break; |
223 |
- } |
224 |
-- |
225 |
-+ |
226 |
- // |
227 |
- // send status request - "status" - 6B |
228 |
- // |
229 |
-@@ -222,5 +225,5 @@ |
230 |
- // "atomically" copy the data into working set |
231 |
- // |
232 |
- memcpy(info.apcupsd.items, apc.items, sizeof(info.apcupsd.items)); |
233 |
-- return 0; |
234 |
-+ return; |
235 |
- } |
236 |
---- a/src/apcupsd.h |
237 |
-+++ b/src/apcupsd.h |
238 |
-@@ -49,6 +49,6 @@ |
239 |
- } APCUPSD_S, *PAPCUPSD_S; |
240 |
- |
241 |
- /* Service routine for the conky main thread */ |
242 |
--int update_apcupsd(void); |
243 |
-+void update_apcupsd(void); |
244 |
- |
245 |
- #endif /*APCUPSD_H_*/ |
246 |
|
247 |
diff --git a/app-admin/conky/files/conky-1.9.0-default-graph-size.patch b/app-admin/conky/files/conky-1.9.0-default-graph-size.patch |
248 |
deleted file mode 100644 |
249 |
index 02f64e314e0..00000000000 |
250 |
--- a/app-admin/conky/files/conky-1.9.0-default-graph-size.patch |
251 |
+++ /dev/null |
252 |
@@ -1,18 +0,0 @@ |
253 |
-diff -r -U 5 conky-1.9.0/src/specials.c conky-1.9.0/src/specials.c |
254 |
---- conky-1.9.0/src/specials.c 2012-05-03 22:13:47.000000000 +0100 |
255 |
-+++ conky-1.9.0/src/specials.c 2013-02-27 21:16:15.856669451 +0000 |
256 |
-@@ -186,12 +186,12 @@ |
257 |
- g->scale = defscale; |
258 |
- if (sscanf(args, "%1023s %d,%d %x %x", buf, &g->height, &g->width, &g->first_colour, &g->last_colour) == 5) { |
259 |
- return strndup(buf, text_buffer_size); |
260 |
- } |
261 |
- buf[0] = '\0'; |
262 |
-- g->height = 25; |
263 |
-- g->width = 0; |
264 |
-+ g->height = default_graph_height; |
265 |
-+ g->width = default_graph_width; |
266 |
- if (sscanf(args, "%x %x %u", &g->first_colour, &g->last_colour, &g->scale) == 3) { |
267 |
- return NULL; |
268 |
- } |
269 |
- g->scale = defscale; |
270 |
- if (sscanf(args, "%x %x", &g->first_colour, &g->last_colour) == 2) { |
271 |
|
272 |
diff --git a/app-admin/conky/files/conky-1.9.0-diskio-dmmajor.patch b/app-admin/conky/files/conky-1.9.0-diskio-dmmajor.patch |
273 |
deleted file mode 100644 |
274 |
index db3516aa292..00000000000 |
275 |
--- a/app-admin/conky/files/conky-1.9.0-diskio-dmmajor.patch |
276 |
+++ /dev/null |
277 |
@@ -1,23 +0,0 @@ |
278 |
---- a/src/linux.c |
279 |
-+++ b/src/linux.c |
280 |
-@@ -80,6 +80,10 @@ |
281 |
- #define NBD_MAJOR 43 |
282 |
- #endif |
283 |
- |
284 |
-+#if !defined(DM_MAJOR) |
285 |
-+#define DM_MAJOR 253 |
286 |
-+#endif |
287 |
-+ |
288 |
- #ifdef HAVE_IWLIB |
289 |
- #include <iwlib.h> |
290 |
- #endif |
291 |
-@@ -2336,7 +2340,8 @@ int update_diskio(void) |
292 |
- * |
293 |
- * XXX: ignore devices which are part of a SW RAID (MD_MAJOR) */ |
294 |
- if (col_count == 5 && major != LVM_BLK_MAJOR && major != NBD_MAJOR |
295 |
-- && major != RAMDISK_MAJOR && major != LOOP_MAJOR) { |
296 |
-+ && major != RAMDISK_MAJOR && major != LOOP_MAJOR |
297 |
-+ && major != DM_MAJOR ) { |
298 |
- /* check needed for kernel >= 2.6.31, see sf #2942117 */ |
299 |
- if (is_disk(devbuf)) { |
300 |
- total_reads += reads; |
301 |
|
302 |
diff --git a/app-admin/conky/files/conky-1.9.0-lines-fix.patch b/app-admin/conky/files/conky-1.9.0-lines-fix.patch |
303 |
deleted file mode 100644 |
304 |
index de48ab95e48..00000000000 |
305 |
--- a/app-admin/conky/files/conky-1.9.0-lines-fix.patch |
306 |
+++ /dev/null |
307 |
@@ -1,36 +0,0 @@ |
308 |
-diff -urN old/src/conky.c new/src/conky.c |
309 |
---- old/src/conky.c 2012-05-03 23:22:21.000000000 +0200 |
310 |
-+++ new/src/conky.c 2012-08-15 00:06:59.256311301 +0200 |
311 |
-@@ -3065,12 +3065,26 @@ |
312 |
- og = g; |
313 |
- } |
314 |
- |
315 |
-- /* this is mugfugly, but it works */ |
316 |
-- XDrawLine(display, window.drawable, window.gc, |
317 |
-- cur_x + i + 1, |
318 |
-- specials[special_index].dotgraph ? og : by + h, |
319 |
-- cur_x + i + 1, |
320 |
-- g); |
321 |
-+ if (specials[special_index].dotgraph) { |
322 |
-+ if (og == g) { |
323 |
-+ XDrawPoint(display, window.drawable, |
324 |
-+ window.gc, cur_x + i + 1, g); |
325 |
-+ } else { |
326 |
-+ XDrawLine(display, window.drawable, window.gc, |
327 |
-+ cur_x + i + 1, |
328 |
-+ og, |
329 |
-+ cur_x + i + 1, |
330 |
-+ g); |
331 |
-+ } |
332 |
-+ } else { |
333 |
-+ /* this is mugfugly, but it works */ |
334 |
-+ XDrawLine(display, window.drawable, window.gc, |
335 |
-+ cur_x + i + 1, |
336 |
-+ by + h, |
337 |
-+ cur_x + i + 1, |
338 |
-+ g); |
339 |
-+ } |
340 |
-+ |
341 |
- ++j; |
342 |
- } |
343 |
- if (tmpcolour) free(tmpcolour); |
344 |
|
345 |
diff --git a/app-admin/conky/files/conky-1.9.0-ncurses.patch b/app-admin/conky/files/conky-1.9.0-ncurses.patch |
346 |
deleted file mode 100644 |
347 |
index 91043ed4205..00000000000 |
348 |
--- a/app-admin/conky/files/conky-1.9.0-ncurses.patch |
349 |
+++ /dev/null |
350 |
@@ -1,31 +0,0 @@ |
351 |
-From fd9462da5ed12369fc6a72e42ebc45c6707403fb Mon Sep 17 00:00:00 2001 |
352 |
-From: Pavel Labath <pavelo@×××××××.sk> |
353 |
-Date: Fri, 13 Jul 2012 13:41:09 +0200 |
354 |
-Subject: [PATCH] Fix "conky failes to build with --disable-ncurses" (sf.net #3541329) |
355 |
- |
356 |
---- |
357 |
- src/conky.c | 4 ++-- |
358 |
- 1 files changed, 2 insertions(+), 2 deletions(-) |
359 |
- |
360 |
-diff --git a/src/conky.c b/src/conky.c |
361 |
-index c5b4bed..17fe1a7 100644 |
362 |
---- a/src/conky.c |
363 |
-+++ b/src/conky.c |
364 |
-@@ -885,12 +885,12 @@ void generate_text_internal(char *p, int p_max_size, |
365 |
- OBJ(cpu) { |
366 |
- if (cur->cpu_usage) { |
367 |
- if (obj->data.i > info.cpu_count) { |
368 |
-- static bool warned = false; |
369 |
-+ static int warned = 0; |
370 |
- if(!warned) { |
371 |
- NORM_ERR("obj->data.i %i info.cpu_count %i", |
372 |
- obj->data.i, info.cpu_count); |
373 |
- NORM_ERR("attempting to use more CPUs than you have!"); |
374 |
-- warned = true; |
375 |
-+ warned = 1; |
376 |
- } |
377 |
- } else { |
378 |
- percent_print(p, p_max_size, |
379 |
--- |
380 |
-1.7.0.4 |
381 |
- |
382 |
|
383 |
diff --git a/app-admin/conky/files/conky-1.9.0-tinfo.patch b/app-admin/conky/files/conky-1.9.0-tinfo.patch |
384 |
deleted file mode 100644 |
385 |
index 0018a726f3f..00000000000 |
386 |
--- a/app-admin/conky/files/conky-1.9.0-tinfo.patch |
387 |
+++ /dev/null |
388 |
@@ -1,22 +0,0 @@ |
389 |
---- a/configure.ac.in |
390 |
-+++ b/configure.ac.in |
391 |
-@@ -134,7 +134,7 @@ |
392 |
- |
393 |
- AM_CONDITIONAL(BUILD_NCURSES, test x$want_ncurses = xyes) |
394 |
- if test x$want_ncurses = xyes; then |
395 |
-- conky_LIBS="$conky_LIBS -lncurses" |
396 |
-+ PKG_CHECK_MODULES(ncurses,ncurses,conky_LIBS="$conky_LIBS $ncurses_LIBS",AC_MSG_ERROR([ncurses not found])) |
397 |
- AC_DEFINE(NCURSES, 1, [Define for ncurses support]) |
398 |
- AC_CHECK_HEADERS([ncurses.h], [], AC_MSG_ERROR([required header(s) not found])) |
399 |
- fi |
400 |
---- a/configure.ac |
401 |
-+++ b/configure.ac |
402 |
-@@ -134,7 +134,7 @@ |
403 |
- |
404 |
- AM_CONDITIONAL(BUILD_NCURSES, test x$want_ncurses = xyes) |
405 |
- if test x$want_ncurses = xyes; then |
406 |
-- conky_LIBS="$conky_LIBS -lncurses" |
407 |
-+ PKG_CHECK_MODULES(ncurses,ncurses,conky_LIBS="$conky_LIBS $ncurses_LIBS",AC_MSG_ERROR([ncurses not found])) |
408 |
- AC_DEFINE(NCURSES, 1, [Define for ncurses support]) |
409 |
- AC_CHECK_HEADERS([ncurses.h], [], AC_MSG_ERROR([required header(s) not found])) |
410 |
- fi |
411 |
|
412 |
diff --git a/app-admin/conky/files/conky-1.9.0-update-noaa-metar-uri.patch b/app-admin/conky/files/conky-1.9.0-update-noaa-metar-uri.patch |
413 |
deleted file mode 100644 |
414 |
index 0dbf3d3fada..00000000000 |
415 |
--- a/app-admin/conky/files/conky-1.9.0-update-noaa-metar-uri.patch |
416 |
+++ /dev/null |
417 |
@@ -1,11 +0,0 @@ |
418 |
---- a/src/weather.c |
419 |
-+++ b/src/weather.c |
420 |
-@@ -858,7 +858,7 @@ |
421 |
- } |
422 |
- } else |
423 |
- #endif /* XOAP */ |
424 |
-- if (strstr(uri, "weather.noaa.gov")) { |
425 |
-+ if (strstr(uri, "tgftp.nws.noaa.gov")) { |
426 |
- strcat(uri, locID); |
427 |
- strcat(uri, ".TXT"); |
428 |
- } else if (!strstr(uri, "localhost") && !strstr(uri, "127.0.0.1")) { |
429 |
|
430 |
diff --git a/app-admin/conky/files/conky-1.9.0-update-when-message-count-decreases.patch b/app-admin/conky/files/conky-1.9.0-update-when-message-count-decreases.patch |
431 |
deleted file mode 100644 |
432 |
index dd422c584e3..00000000000 |
433 |
--- a/app-admin/conky/files/conky-1.9.0-update-when-message-count-decreases.patch |
434 |
+++ /dev/null |
435 |
@@ -1,75 +0,0 @@ |
436 |
-diff --git a/src/mail.c b/src/mail.c |
437 |
-index 7f60ba3..882b7c8 100644 |
438 |
---- a/src/mail.c |
439 |
-+++ b/src/mail.c |
440 |
-@@ -630,8 +630,15 @@ int imap_check_status(char *recvbuf, struct mail_s *mail) |
441 |
- |
442 |
- void imap_unseen_command(struct mail_s *mail, unsigned long old_unseen, unsigned long old_messages) |
443 |
- { |
444 |
-- if (strlen(mail->command) > 1 && (mail->unseen > old_unseen |
445 |
-- || (mail->messages > old_messages && mail->unseen > 0))) { |
446 |
-+ /* |
447 |
-+ * Georg Hopp (2012-12-23): |
448 |
-+ * Well, i will read mails from time to time and i want the unseen |
449 |
-+ * count to be reduced when they are read...so, this seems wrong. |
450 |
-+ * Try a better one.... :) |
451 |
-+ */ |
452 |
-+ if (strlen(mail->command) > 1 |
453 |
-+ && (mail->unseen != old_unseen |
454 |
-+ || mail->messages != old_messages)) { |
455 |
- // new mail goodie |
456 |
- if (system(mail->command) == -1) { |
457 |
- perror("system()"); |
458 |
-@@ -813,7 +820,7 @@ static void *imap_thread(void *arg) |
459 |
- if (strlen(recvbuf) > 2) { |
460 |
- unsigned long messages, recent = 0; |
461 |
- char *buf = recvbuf; |
462 |
-- char force_check = 0; |
463 |
-+ char force_check = 1; |
464 |
- buf = strstr(buf, "EXISTS"); |
465 |
- while (buf && strlen(buf) > 1 && strstr(buf + 1, "EXISTS")) { |
466 |
- buf = strstr(buf + 1, "EXISTS"); |
467 |
-@@ -825,9 +832,7 @@ static void *imap_thread(void *arg) |
468 |
- } |
469 |
- if (sscanf(buf, "* %lu EXISTS\r\n", &messages) == 1) { |
470 |
- timed_thread_lock(mail->p_timed_thread); |
471 |
-- if (mail->messages != messages) { |
472 |
-- force_check = 1; |
473 |
-- } |
474 |
-+ force_check = 1; |
475 |
- timed_thread_unlock(mail->p_timed_thread); |
476 |
- } |
477 |
- } |
478 |
-@@ -850,7 +855,10 @@ static void *imap_thread(void *arg) |
479 |
- * something other than 0, or we had a timeout |
480 |
- */ |
481 |
- buf = recvbuf; |
482 |
-- if (recent > 0 || (buf && strstr(buf, " FETCH ")) || fetchtimeout.tv_sec == 0 || force_check) { |
483 |
-+ if (recent > 0 |
484 |
-+ || (buf && strstr(buf, " FETCH ")) |
485 |
-+ || (buf && strstr(buf, " EXPUNGE ")) |
486 |
-+ || fetchtimeout.tv_sec == 0 || force_check) { |
487 |
- // re-check messages and unseen |
488 |
- if (imap_command(sockfd, "DONE\r\n", recvbuf, "a5 OK")) { |
489 |
- fail++; |
490 |
-@@ -868,6 +876,9 @@ static void *imap_thread(void *arg) |
491 |
- fail++; |
492 |
- break; |
493 |
- } |
494 |
-+ imap_unseen_command(mail, old_unseen, old_messages); |
495 |
-+ old_unseen = mail->unseen; |
496 |
-+ old_messages = mail->messages; |
497 |
- strncpy(sendbuf, "a5 IDLE\r\n", MAXDATASIZE); |
498 |
- if (imap_command(sockfd, sendbuf, recvbuf, "+ idling")) { |
499 |
- fail++; |
500 |
-@@ -886,10 +897,7 @@ static void *imap_thread(void *arg) |
501 |
- fail++; |
502 |
- break; |
503 |
- } |
504 |
-- imap_unseen_command(mail, old_unseen, old_messages); |
505 |
- fail = 0; |
506 |
-- old_unseen = mail->unseen; |
507 |
-- old_messages = mail->messages; |
508 |
- } |
509 |
- if (fail) break; |
510 |
- } else { |