Overview
SHA1 Hash: | e6d1cd96793dcbf7e3ea27b81d35196cf45b047d |
---|---|
Date: | 2007-09-25 19:32:07 |
User: | jnc |
Comment: | Merger w/fossil chat update (5e3f) |
Timelines: | ancestors | descendants | both | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified tools/fossil_chat.tcl from [713a7ff910] to [eef7e18abf].
@@ -11,12 +11,10 @@ # Setup the user interface wm title . Fossil-Chat wm iconname . [wm title .] -set ::PRIVATE 0 - menu .mb -type menubar if {$tcl_platform(platform)=="unix" && $tcl_platform(os)!="Darwin"} { pack .mb -side top -fill x } else { . config -menu .mb @@ -23,11 +21,10 @@ } .mb add cascade -label File -underline 0 -menu .mb.file menu .mb.file -tearoff 0 .mb.file add command -label Send -command send_message .mb.file add command -label {Remove older messages} -command cleanup_record -.mb.file add checkbutton -label {Private} -variable PRIVATE .mb.file add separator .mb.file add command -label {Exit} -command exit frame .who pack .who -side right -anchor n -fill y @@ -37,14 +34,12 @@ pack .who.list -side top -anchor nw -expand 1 -padx 5 label .who.time -text {} -justify right proc update_time {} { after 1000 update_time set now [clock seconds] - set time1 [clock format [expr {$now-4*3600}] -format {%H:%M} -gmt 1] - set time2 [clock format [expr {$now+10*3600}] -format {%H:%M} -gmt 1] - set time3 [clock format $now -format %H:%M -gmt 1] - .who.time config -text "AEST: $time2\nUTC: $time3\nEST: $time1" + set time [clock format $now -format %H:%M -gmt 1] + .who.time config -text "UTC: $time" } update_time pack .who.time -side bottom -anchor sw frame .input @@ -105,15 +100,11 @@ set txt [.input.t get 1.0 end] .input.t delete 1.0 end regsub -all "\[ \t\n\f\r\]+" [string trim $txt] { } txt if {$txt==""} return global SOCKET - if {$::PRIVATE} { - puts $SOCKET [list private_message $txt [list dan drh]] - } else { - puts $SOCKET [list message $txt] - } + puts $SOCKET [list message $txt] flush $SOCKET } .mb add cascade -label "Transfer" -underline 0 -menu .mb.files menu .mb.files -tearoff 0 @@ -154,16 +145,11 @@ if {$openfile==""} return set f [open $openfile] fconfigure $f -translation binary set data [read $f] close $f - if {$::PRIVATE} { - puts $SOCKET [list private_file [file tail $openfile] [encode $data] \ - [list dan drh]] - } else { - puts $SOCKET [list file [file tail $openfile] [encode $data]] - } + puts $SOCKET [list file [file tail $openfile] [encode $data]] flush $SOCKET set time [clock format [clock seconds] -format {%H:%M} -gmt 1] .msg.t insert end "\[$time\] sent file [file tail $openfile]\ - [string length $data] bytes\n" meta .msg.t see end @@ -214,29 +200,27 @@ set ulist {} foreach u [lrange $line 1 end] { append ulist $u\n } .who.list config -text [string trim $ulist] - } elseif {$cmd=="message"||$cmd=="private_message"} { + } elseif {$cmd=="message"} { set time [clock format [clock seconds] -format {%H:%M} -gmt 1] set from [lindex $line 1] .msg.t insert end "\[$time $from\] " meta [lindex $line 2]\n norm .msg.t see end - set current_focus [focus] bell wm deiconify . update raise . - focus $current_focus } elseif {$cmd=="noop"} { # do nothing } elseif {$cmd=="meta"} { set now [clock seconds] set time [clock format $now -format {%H:%M} -gmt 1] .msg.t insert end "\[$time\] [lindex $line 1]\n" meta .msg.t see end - } elseif {$cmd=="file"||$cmd=="private_file"} { + } elseif {$cmd=="file"} { if {[info commands handle_file]=="handle_file"} { handle_file [lindex $line 1] [lindex $line 2] [lindex $line 3] } } }