patch d280db07c18bbe0bee399bd33a23c813c6215823
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Tue Dec 4 23:41:31 CET 2018
* Add support for SNI
hunk ./idlebiff 651
+ if {[ info exists conf(sni) ]} { set sni "-servername $conf(sni)" } \
+ else { set sni {} }
hunk ./idlebiff 661
+ $sni \
patch a960193b96b178a92741ceb58850f17b29629c95
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Tue Dec 4 21:12:31 CET 2018
* Simplify parser of configuration file
hunk ./idlebiff 185
- set sep [ string first = $lin ]
- set key [ string range $lin 0 [ - $sep 1 ] ]
- set val [ string range $lin [ + $sep 1 ] end ]
+ set lconf [ split $lin = ]
+ set val [ join [ lassign $lconf key ] = ]
patch 3994fdd764ce973cd13650e4fd820083d9e8b2b5
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Tue Dec 4 20:53:19 CET 2018
* Add title to password dialog
hunk ./idlebiff 148
+ wm title .tl {idlebiff: password}
patch e8534a5cb083b3d82aff297783e2c5d2d683c8d3
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Mon Sep 17 16:50:09 CEST 2018
* Reset client keepalive when server keepalive (untagged "OK still here" like response) is detected
hunk ./idlebiff 515
+ variable ::shared::ka
+ variable ::shared::conf
hunk ./idlebiff 521
- elseif { $idle } { if {[ eq $prim * ]} { idle_cycle $con 1 } } \
+ elseif { $idle } \
+ {
+ if {[ eq $prim * ]} \
+ {
+ if {[ ok_untagged $linea ]} \
+ {
+ after cancel $ka
+ set ka [ after ${conf(keepalive)}000 { idle_cycle $con 0 } ]
+ } \
+ else { idle_cycle $con 1 } \
+ } \
+ } \
patch 0b7e378659f9aec5eff13490775050929649bda2
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Sat Sep 8 21:34:57 CEST 2018
* Set icon to hourglass when the connection is lost and reconnecting
hunk ./idlebiff 234
+ update_img $::shared::img_chk
hunk ./idlebiff 271
+ variable ::shared::img_chk
hunk ./idlebiff 274
+ update_img $img_chk
patch 459541a83671f7510008f6add9eed8e5502ea6d3
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Thu Sep 6 01:00:58 CEST 2018
* Move reset idle to exit_idle
hunk ./idlebiff 356
- if { $idle } \
- {
- set idle 0
- exit_idle $con
- }
+ if { $idle } { exit_idle $con }
hunk ./idlebiff 374
+ variable ::shared::idle
+
+ set idle 0
hunk ./idlebiff 423
- variable ::shared::idle
hunk ./idlebiff 427
- set idle 0
patch bd7e29cb071eb7be716e9bb785540882402845f3
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Wed Sep 5 19:21:16 CEST 2018
* Set icon to hourglass when checking mail (searching) and waiting for logout
hunk ./idlebiff 351
+ variable ::shared::img_chk
hunk ./idlebiff 354
+ update_img $img_chk
hunk ./idlebiff 396
-
+ variable ::shared::img_chk
+
+ update_img $img_chk
patch 54015fb789a93e0b2f72a72ded21190f68fc4f59
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Tue Sep 4 21:38:00 CEST 2018
* Replace question mark icon with hourglass
binary ./check.png
patch 0e5aa389db90fbbc6e6b9515acd3aa92c94731a7
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Tue Sep 4 19:32:19 CEST 2018
* Move non-logout code to cleanup function
hunk ./idlebiff 337
- variable ::shared::ka
- variable ::shared::idle
hunk ./idlebiff 339
- after cancel $ka
- if { $idle } \
- {
- set idle 0
- exit_idle $con
- }
hunk ./idlebiff 350
+ variable ::shared::ka
+ variable ::shared::idle
+
+ after cancel $ka
+ if { $idle } \
+ {
+ set idle 0
+ exit_idle $con
+ }
patch 3eb89bff44a913b4c504d590cf62cd9c47dd3936
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Tue Sep 4 19:17:08 CEST 2018
* For logout, exit from idle mode only when it is
hunk ./idlebiff 342
- set idle 0
- exit_idle $con
+ if { $idle } \
+ {
+ set idle 0
+ exit_idle $con
+ }
patch 7eb7e2ff46a284866aa04fa8679ec731279c63c7
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Sun Sep 2 21:20:08 CEST 2018
* Implement correctly LOGOUT command according to RFC 3501, add logout_timeout config option
hunk ./.idlebiffrc 16
+timeout_logout=2
hunk ./idlebiff 33
+proc setappend { var args } { upvar 1 $var v; set v [ join $args {} ] }
hunk ./idlebiff 44
- variable tag 1
+ variable ntag 1
hunk ./idlebiff 77
+ variable tag
hunk ./idlebiff 284
- if {[ catch { puts $con $com } ]} \
+ set r [ catch { puts $con $com } ]
+ if {[ eq $com LOGOUT ]} return
+ if { $r } \
hunk ./idlebiff 296
- variable ::static::tag
-
- if {[ == $tag 10000 ]} { set tag 1 }
- append tcom $prefix [ format %04d $tag ] { } $com
+ variable ::static::ntag
+ variable ::shared::tag
+
+ if {[ == $ntag 10000 ]} { set ntag 1 }
+ setappend tag $prefix [ format %04d $ntag ]
+ append tcom $tag { } $com
hunk ./idlebiff 303
- incr tag
+ incr ntag
hunk ./idlebiff 306
-proc ok_tagged linea \
+proc ok_tagged { linea { tag {A\d+} } } \
hunk ./idlebiff 308
- append rexp {^} A {\d+ ok.*$}
+ append rexp {^} $tag { ok.*$}
hunk ./idlebiff 337
+ variable ::shared::ka
+ variable ::shared::idle
+ variable ::shared::conf
+
+ after cancel $ka
+ set idle 0
+ exit_idle $con
+ fileevent $con readable { parse_logout $con }
+ after ${conf(timeout_logout)}000 \
+ {
+ close $con
+ exit 0
+ }
hunk ./idlebiff 351
- close $con
hunk ./idlebiff 356
- exit 0
hunk ./idlebiff 543
+}
+
+proc parse_logout con \
+{
+ variable ::shared::conf
+ variable ::shared::tag
+
+ if {[ catch { gets $con linea } ]} return
+ if { $conf(imap_trace) } { puts "S: $linea" }
+ if {[ ok_tagged $linea $tag ]} \
+ {
+ close $con
+ exit 0
+ }
patch dc30edb7135409c41683a29f0a23684e7805693c
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Sun Sep 2 19:44:50 CEST 2018
* Use defaulted argument in imap_command_tagged function, ifempty function not necessary
hunk ./idlebiff 33
-proc ifempty { str alt } { if {[ eq $str {} ]} { return $alt } else { return $str } }
hunk ./idlebiff 290
-proc imap_command_tagged { con com args } \
+proc imap_command_tagged { con com { prefix A } } \
hunk ./idlebiff 295
- append tcom [ ifempty $args A ] [ format %04d $tag ] { } $com
+ append tcom $prefix [ format %04d $tag ] { } $com
patch 1fa87126792bb5a286620f7604fe9c0affd81637
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Fri Aug 31 22:07:57 CEST 2018
* Simplify ifempty function
hunk ./idlebiff 33
-proc ifempty { str alt } \
-{
- return [ expr { [ eq $str {} ] ? $alt : $str } ]
-}
+proc ifempty { str alt } { if {[ eq $str {} ]} { return $alt } else { return $str } }