Wait for response of SEARCH (get the number of messages) before sending the IDLE command
patch 287378ffe6ada32c8197ae2c266578bf469f554e
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Wed Nov 16 23:03:15 CET 2016
* Wait for response of SEARCH (get the number of messages) before sending the IDLE command
diff -rN -u old-idlebiff/idlebiff new-idlebiff/idlebiff
--- old-idlebiff/idlebiff 2024-05-06 08:21:10.585077994 +0200
+++ new-idlebiff/idlebiff 2024-05-06 08:21:10.585077994 +0200
@@ -349,8 +349,8 @@
after cancel $ka
set idle 0
exit_idle $con
- if $check { do_search $con }
- enter_idle $con
+ if $check { do_search $con } \
+ else { enter_idle $con }
set ka [ after ${conf(keepalive)}000 { idle_cycle $con 0 } ]
}
@@ -362,7 +362,6 @@
fileevent $con readable { parse_idle_check $con }
enter_mailbox $con
do_search $con
- enter_idle $con
set ka [ after ${conf(keepalive)}000 { idle_cycle $con 0 } ]
}
@@ -440,6 +439,7 @@
else { set rexpr {^\*\s+search\s+(.*)$} }
if [ regexp -lineanchor -nocase $rexpr $linea -> res ] \
{
+ enter_idle $con
if !$cap(esearch) { set res [ llength $res ] }
set new_messages $res
if { $new_messages > 0 } \