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"
}
} 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" }
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
}
}
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 {