patch 83b5d85caf2a4557ec715816e73d43b4a9b8ac06
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Wed Nov 16 21:33:45 CET 2016
* Add config option "criteria" for IMAP SEARCH criteria (UNSEEN by default)
hunk ./.idlebiffrc 22
+criteria=
hunk ./idlebiff 46
+ variable criteria
hunk ./idlebiff 173
+proc set_params { } \
+{
+ variable ::shared::conf
+ variable ::shared::criteria
+
+ if { [ info exists conf(criteria) ] && $conf(criteria)!="" } { set criteria $conf(criteria) } \
+ else { set criteria UNSEEN }
+}
+
hunk ./idlebiff 323
-proc ask_unseen con \
+proc do_search con \
hunk ./idlebiff 326
-
- if $cap(esearch) { imap_command_tagged $con "SEARCH RETURN (COUNT) UNSEEN" } \
- else { imap_command_tagged $con "SEARCH UNSEEN" }
+ variable ::shared::criteria
+
+ if $cap(esearch) { imap_command_tagged $con "SEARCH RETURN (COUNT) $criteria" } \
+ else { imap_command_tagged $con "SEARCH $criteria" }
hunk ./idlebiff 352
- if $check { ask_unseen $con }
+ if $check { do_search $con }
hunk ./idlebiff 364
- ask_unseen $con
+ do_search $con
hunk ./idlebiff 428
- else { parse_unseen $linea }
+ else { parse_search $con $linea }
hunk ./idlebiff 431
-proc parse_unseen linea \
+proc parse_search { con linea } \
hunk ./idlebiff 540
+set_params