Index: openacs-4/packages/xotcl-core/tcl/chat-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/Attic/chat-procs.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/xotcl-core/tcl/chat-procs.tcl 31 Mar 2006 07:56:21 -0000 1.4 +++ openacs-4/packages/xotcl-core/tcl/chat-procs.tcl 31 Mar 2006 08:42:57 -0000 1.5 @@ -165,13 +165,22 @@ my get_all } - Chat instproc user_link { user_id {color ""} } { + Chat instproc user_color { user_id } { + my instvar array + if { ![nsv_exists $array-color $user_id] } { + my log "warning: Cannot find user color for chat ($array-color $user_id)!" + return [lindex [[my info class] set colors] 0] + } + return [nsv_get $array-color $user_id] + } + + Chat instproc user_link { -user_id -color } { if {$user_id > 0} { acs_user::get -user_id $user_id -array user set name [expr {$user(screen_name) ne "" ? $user(screen_name) : $user(name)}] #set name [chat_user_name $user_id] set url "/shared/community-member?user%5fid=$user_id" - if { $color eq "" } { + if {![info exists color]} { set color [my user_color $user_id] } set creator "$name" @@ -193,7 +202,10 @@ set color [$child color] set timelong [clock format [$child time]] set timeshort [clock format [$child time] -format {[%H:%M:%S]}] - append result "

$timeshort[my user_link $user_id $color]:[my encode $msg]

\n" + set userlink [my user_link -user_id $user_id -color $color] + append result "

$timeshort" \ + "$userlink:" \ + "[my encode $msg]

\n" } return $result }