From 2bc774fb1dcd6a37fc47460d3561e389b3267e84 Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Fri, 20 Jun 2008 17:15:12 +0100 Subject: [PATCH] fixed issues with traffic messages --- bin/bf_xmpp.tcl | 12 +++++++----- lib/chatwidget/chatwidget.tcl | 2 +- nokit.tcl | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/bin/bf_xmpp.tcl b/bin/bf_xmpp.tcl index f70fe2b..2b28c0b 100644 --- a/bin/bf_xmpp.tcl +++ b/bin/bf_xmpp.tcl @@ -553,12 +553,13 @@ proc ::xmppplugin::OnPresenceChange {ctx jlib xmldata} { if {[llength $x] > 0} { array set a [linsert [wrapper::getattrlist $xmldata] 0 type available] jlib::splitjid $a(from) room nick + set time [clock seconds] # avoid people just becoming active/inactive if {$a(type) eq "available"} { if {[set present [lsearch [$jlib muc participants $room] $a(from)]] == -1} { set status [wrapper::getcdata \ [wrapper::getfirstchildwithtag $xmldata status]] - Callback $ctx traffic entered $room $nick -status $status + Callback $ctx traffic entered $room $nick {} $time -status $status } else { Log $ctx "presence available for $nick who is present index $present" } @@ -578,7 +579,7 @@ proc ::xmppplugin::OnPresenceChange {ctx jlib xmldata} { } elseif {$a(type) eq "unavailable"} { set status [wrapper::getcdata \ [wrapper::getfirstchildwithtag $xmldata status]] - Callback $ctx traffic left $room $nick -status $status + Callback $ctx traffic left $room $nick {} $time -status $status } } } err]} { puts stderr "OnPresenceChange: $err" } @@ -1237,11 +1238,11 @@ proc XmppAlert {Session target} { WindowTitle $Session $w $txt } else { WindowTitle $Session $w "[incr count] - $txt" - puts stderr "Alert focus:'$focus' '[focus]' state:[wm state $top]" + #puts stderr "Alert focus:'$focus' '[focus]' state:[wm state $top]" if {[llength $focus] == 0} { # the focus is in some other app - check its not the console if {[llength [console eval focus]] == 0} { - puts stderr "raising and so on" + #puts stderr "raising and so on" wm deiconify $top raise $top } @@ -1388,13 +1389,14 @@ proc XmppCallback {Session context state args} { } traffic { foreach {action target nick new time} $args break + set args [lrange $args 5 end] if {$time eq ""} {set time [clock seconds]} set w [XmppFindWindow $Session $target] if {[winfo class $w] ne "Chatwidget"} {return} switch -exact -- $action { joining { XmppCreateWindow $Session $target -type groupchat} entered { - eval [linsert $args 0 $w name add $nick] + $w name add $nick {*}$args $w message [mc "%s entered" $nick] -nick $nick -time $time -type system } left { diff --git a/lib/chatwidget/chatwidget.tcl b/lib/chatwidget/chatwidget.tcl index 3fe1bef..eef48fc 100644 --- a/lib/chatwidget/chatwidget.tcl +++ b/lib/chatwidget/chatwidget.tcl @@ -598,7 +598,7 @@ proc chatwidget::PaneMapImpl {pane axis offset} { set size [winfo $axis $pane] } set sashpos [expr {$size + $offset}] - puts stderr "PaneMapImpl $pane $axis $offset : size:$size sashpos:$sashpos" + #puts stderr "PaneMapImpl $pane $axis $offset : size:$size sashpos:$sashpos" after 0 [list $pane sashpos 0 $sashpos] } diff --git a/nokit.tcl b/nokit.tcl index bf81a24..d8e84be 100644 --- a/nokit.tcl +++ b/nokit.tcl @@ -3,5 +3,5 @@ if {[lindex $argv 0] eq "irc"} { set argv [lrange $argv 1 end] source [file join [file dirname [info script]] bin irc.tcl] } else { - source [file join [file dirname [info script]] bin demo.tcl] + source [file join [file dirname [info script]] bin bullfrog.tcl] } -- 2.23.0