patch c10ef6fde35c32a02b4d6ceb7731589dd6e207a0
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Fri Aug 31 21:32:14 CEST 2018
* Simplify interface for imap_command_tagged function
hunk ./idlebiff 33
+proc ifempty { str alt } \
+{
+ return [ expr { [ eq $str {} ] ? $alt : $str } ]
+}
+
hunk ./idlebiff 294
-proc imap_command_tagged { con prefix com } \
+proc imap_command_tagged { con com args } \
hunk ./idlebiff 299
- append tcom $prefix [ format %04d $tag ] { } $com
+ append tcom [ ifempty $args A ] [ format %04d $tag ] { } $com
hunk ./idlebiff 304
-proc ok_tagged { linea prefix } \
+proc ok_tagged linea \
hunk ./idlebiff 306
- append rexp {^} $prefix {\d+ ok.*$}
+ append rexp {^} A {\d+ ok.*$}
hunk ./idlebiff 330
- imap_command_tagged $con A "LOGIN $conf(user) $conf(pass)"
+ imap_command_tagged $con "LOGIN $conf(user) $conf(pass)"
hunk ./idlebiff 335
- imap_command_tagged $con A LOGOUT
+ imap_command_tagged $con LOGOUT
hunk ./idlebiff 354
- imap_command_tagged $con A IDLE
+ imap_command_tagged $con IDLE
hunk ./idlebiff 366
- imap_command_tagged $con A "EXAMINE $conf(mailbox)"
+ imap_command_tagged $con "EXAMINE $conf(mailbox)"
hunk ./idlebiff 371
- imap_command_tagged $con A CLOSE
+ imap_command_tagged $con CLOSE
hunk ./idlebiff 378
- imap_command_tagged $con A $search
+ imap_command_tagged $con $search
hunk ./idlebiff 445
- imap_command_tagged $con A CAPABILITY
+ imap_command_tagged $con CAPABILITY
hunk ./idlebiff 456
- if {[ ok_tagged $linea A ]} \
+ if {[ ok_tagged $linea ]} \
hunk ./idlebiff 472
- if {[ ok_tagged $linea A ]} \
+ if {[ ok_tagged $linea ]} \
hunk ./idlebiff 478
- imap_command_tagged $con A CAPABILITY
+ imap_command_tagged $con CAPABILITY
hunk ./idlebiff 488
- if {[ ok_tagged $linea A ]} { init_idle $con }
+ if {[ ok_tagged $linea ]} { init_idle $con }
hunk ./idlebiff 518
- if {[ and $search_resp [ ok_tagged $linea A ] ]} \
+ if {[ and $search_resp [ ok_tagged $linea ] ]} \
hunk ./idlebiff 625
- if { $conf(initial_noop) } { imap_command_tagged $con N NOOP }
+ if { $conf(initial_noop) } { imap_command_tagged $con NOOP N }